Skip to content

Instantly share code, notes, and snippets.

@fadhlirahim
Forked from kamal/baby_talk.rb
Created April 29, 2011 17:48
Show Gist options
  • Save fadhlirahim/948696 to your computer and use it in GitHub Desktop.
Save fadhlirahim/948696 to your computer and use it in GitHub Desktop.
Extending a model in a Rails 3 (pre-3.1) engine
module BabyTalk
class Engine < Rails::Engine
config.to_prepare do
User.class_eval do
has_many :participations, :foreign_key => "participant_id"
has_many :rooms, :through => :participations
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment