我有一份铁路模型2.3出版物,其中载有“归属”版。 当我管理这一积极记录时,发现它第一次运作,但复读这页,给我这个错误,即:t<的
;ActiveRecord:Associations:Belongs ToAssociation:0x10cb2a338>'。
Publication.find(:all, :limit => 10, :order => "date_published desc",
:include => [:version => {:work => :work_type},
:products => {:media_type => :meaning} ])
class Publication < ActiveRecord::Base
acts_as_nested_set
belongs_to :imprint
has_many :products
has_many :subscriptions
belongs_to :cover_image
belongs_to :version
accepts_nested_attributes_for :products, :allow_destroy => true
accepts_nested_attributes_for :subscriptions, :allow_destroy => true
accepts_nested_attributes_for :cover_image, :allow_destroy => true
accepts_nested_attributes_for :version
end
class Version < ActiveRecord::Base
belongs_to :work
has_many(:authorships, :as => :authorable, :include => [:role])
has_many(:user_authorships, :as => :authorable,
:conditions => { :authorizable_type => "User" })
has_many(:organization_authorships, :as => :authorable,
:conditions => { :authorizable_type => "Organization" })
has_one :element, :class_name => "Element", :foreign_key => :version_id
has_many :tag_links, :as => :taggable, :class_name => TagLink
has_many :tags, :through => :tag_links, :class_name => Tag
accepts_nested_attributes_for :authorships, :allow_destroy => true
accepts_nested_attributes_for :work
end