Skip to content

Instantly share code, notes, and snippets.

@kamal
Forked from stympy/subscription_plan.rb
Created April 29, 2011 14:02
Show Gist options
  • Save kamal/948343 to your computer and use it in GitHub Desktop.
Save kamal/948343 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
@julesce
Copy link

julesce commented Mar 26, 2012

Ah don't worry, I figured out that the issue I had was unrelated to this. Thanks though :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment