Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## app/models/posted_item.rb
- class PostedItem < ActiveRecord::Base
- # ...
- has_many :item_classifications
- has_many :taxonomies, :through => 'item_classifications'
- # ...
- end
- ## app/models/taxonomy.rb
- class Taxonomy < ActiveRecord::Base
- has_many :item_classifications
- has_many :posted_items, :through => 'item_classifications'
- end
- ## app/models/item_classification.rb
- class ItemClassification < ActiveRecord::Base
- belongs_to :taxonomy, :counter_cache => :item_count
- belongs_to :posted_item
- end
- ## raises: [plain_text]
- Internal Server Error 500
- Could not find the association "item_classifications" in model Taxonomy
Add Comment
Please, Sign In to add comment