sahiptir var birçok özelliği yoluyla İştefabrika kızı birden Has_many ben birden yapılmış bazı fabrikalar oluşturmak için gereken
İşteTopic
has_many :plan_topics
has_many :plans, :through => :plan_topics
PlanTopic
belongs_to :plan
belongs_to :topic
Plan
has_many :subscriptions
has_many :members, :through => :subscriptions
has_many :plan_topics
has_many :topics, :through => :plan_topics
Subscription
belongs_to :member
belongs_to :plan
Member
has_many :subscriptions
has_many :plans, :through => :subscriptions
ben ne var mankenlerim
Factory.define :topic do |topic|
topic.name "Operations"
end
Factory.define :plan do |plan|
plan.title "A test Finance plan"
plan.price "200"
end
Factory.define :plan_topic do |plan_topic|
plan_topic.topic {|topic| topic.association(:topic)}
plan_topic.plan {|plan| plan.association(:plan)}
end
neler Bunu yapmak istiyorum - Factory (: member_with_subscription)
Factory.define :member_with_subscription do |subscription|
subscription.association(:plan_with_topic)
subscription.association(:member)
end
Bunu yapmanın bir yolu var mı?
Cheers, büyük yeter! – Alex