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

Fixing the first Ruby 1.9 problem with calling a block that has an arity of zero or one

Signed-off-by: Nick Quaranto <nick@quaran.to>
This commit is contained in:
Jason Morrison 2009-06-16 20:12:39 -04:00 committed by Nick Quaranto
parent b92412a782
commit e8ce6b9f26

View file

@ -8,7 +8,7 @@ class Factory
end
def add_to(proxy)
value = @block.call(proxy)
value = @block.arity.zero? ? @block.call : @block.call(proxy)
if Factory::Sequence === value
raise SequenceAbuseError
end