-
-
Save kamal/948343 to your computer and use it in GitHub Desktop.
Extending a model in a Rails 3 (pre-3.1) engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Ah don't worry, I figured out that the issue I had was unrelated to this. Thanks though :-)