I have a factory defined in <Rails-root>/spec/factories/models.rb
:
FactoryGirl.define do
factory :model do
id 1
association :organization, factory: :aureso
name "Default Model"
factory :serie_1 do
id 2
name 'serie_1'
end
factory :serie_2 do
id 3
name 'serie_2'
end
factory :serie_3 do
id 4
name 'serie_3'
end
end
end
I want to get all the factories defined for Class Model
.
I can get factory definitions for all classes with FactoryGirl.factories
, and yes, I can achieve the above using map/reduce. But I want to know if there is any helper method to get all definitions for a model class.
id
attribute, because id creates by database. – Caliginous