Created
November 23, 2008 21:30
-
-
Save dburger/28217 to your computer and use it in GitHub Desktop.
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
| class Message < ActiveRecord::Base | |
| acts_as_nested_set :scope => 'discussable_id = #{discussable_id} AND discussable_type = \'#{discussable_type}\'' | |
| belongs_to :discussable, :polymorphic => true | |
| # ... | |
| end | |
| class Foo < ActiveRecord::Base | |
| has_many :messages, :as => :discussable | |
| end | |
| class Bar < ActiveRecord::Base | |
| has_many :messages, :as => :discussable | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment