Skip to content

Instantly share code, notes, and snippets.

View phoward8020's full-sized avatar

Paul Howard phoward8020

View GitHub Profile
@phoward8020
phoward8020 / using-polymorphic.md
Last active August 29, 2015 14:14
Creating new records with polymorphic associations

Creating new records with polymorphic associations

Step One - Begin with the end in mind:

checkins.create({note:"This is another test"})

Our ultimate goal is to create a checkin record, so start there.

Step Two: Create link to the polymorphable model:

#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'