Cacheing an ActiveRecord Object that has_many through:
问题 When I try to cache an ActiveRecord object that has a has_many through: relationship, I can't cache the object until I reload or save it. person.rb: class Person < ActiveRecord::Base attr_accessible :name has_many :person_locations has_many :locations, through: :person_locations has_many :person_items has_many :items, through: :person_items end person_item.rb: class PersonItem < ActiveRecord::Base attr_accessible :item_id, :person_id belongs_to :item belongs_to :person end item.rb: class Item