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

Undefine #id if defined to take advantage of method_missing

This commit is contained in:
Joshua Clayton 2011-12-18 23:10:03 -05:00
parent e11b423731
commit 26f1727e1f

View file

@ -1,5 +1,7 @@
module FactoryGirl
class Evaluator
undef_method(:id) if method_defined?(:id)
def initialize(build_strategy, overrides = {}, callbacks = [])
@build_strategy = build_strategy
@overrides = overrides
@ -18,14 +20,6 @@ module FactoryGirl
end
end
def id
if @cached_attributes.key?(:id)
@cached_attributes[:id]
else
super
end
end
def __overrides
@overrides
end