如何使用has_many关联在FactoryGirl中建立工厂
有人可以告诉我是否只是以错误的方式进行设置吗? 我有以下具有has_many.through关联的模型: class Listing < ActiveRecord::Base attr_accessible ... has_many :listing_features has_many :features, :through => :listing_features validates_presence_of ... ... end class Feature < ActiveRecord::Base attr_accessible ... validates_presence_of ... validates_uniqueness_of ... has_many :listing_features has_many :listings, :through => :listing_features end class ListingFeature < ActiveRecord::Base attr_accessible :feature_id, :listing_id belongs_to :feature belongs_to :listing end 我正在使用Rails …