Rails 4, has_many through association - finding associated objects
问题 I'm wondering why Item.where(category: x) isn't working for me. I expect this statement to return all items which are categorized under category x. Please see below my associations: class Category < ActiveRecord::Base has_many :categorizations has_many :items, :through => :categorizations end class Item < ActiveRecord::Base has_many :categorizations has_many :categories, :through => :categorizations end class Categorization < ActiveRecord::Base belongs_to :item belongs_to :category end