Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@diebels727
diebels727 / association.rb
Created March 18, 2011 00:13
Super-Meta-Polymorphic
#Where the associations table has sourcable_id,sourcable_type,targetable_id,targetable_type
class Association < ActiveRecord::Base
include Relatable
belongs_to_association :sourcable => :sourcable, :targetable => :targetable
end
#OR _any_ table that we want to be an association table can become one (if the source and target id and type columns do not exist, then the mixin creates them)
class AssociationTables < ActiveRecord::Base
@ryanb
ryanb / favorite_gems.md
Created March 4, 2011 17:31
A list of my favorite gems for various tasks.