Report abuse

The models


			
class Collection < ActiveRecord::Base
  has_many :items, :through => :collected_items
  belongs_to :user
end

class CollectedItem < ActiveRecord::Base
  belongs_to :item
  belongs_to :collection
end

class Item < ActiveRecord::Base
  has_many :collections, :through => :collected_items
end

The error


			
>> coll.items
ActiveRecord::HasManyThroughAssociationNotFoundError: Could not find the association :collected_item in model Collection
        from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/reflection.rb:169:in `check_validity!'
        from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/associations/has_many_through_association.rb:6:in `initialize'
        from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/associations.rb:920:in `new'
        from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/associations.rb:920:in `items'
        from (irb):18
        from :0