Skip to content

Instantly share code, notes, and snippets.

Paul Howard phoward8020

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

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:

View osx-for-hackers.sh
#!/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'
You can’t perform that action at this time.