1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot.git synced 2022-11-09 11:43:51 -05:00
thoughtbot--factory_bot/lib/factory_girl/declaration/association.rb

18 lines
359 B
Ruby
Raw Normal View History

module FactoryGirl
class Declaration
class Association < Declaration
def initialize(name, options)
super(name, false)
@options = options
end
private
def build
factory_name = @options.delete(:factory) || name
[Attribute::Association.new(name, factory_name, @options)]
end
end
end
end