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:
parent
e11b423731
commit
26f1727e1f
1 changed files with 2 additions and 8 deletions
|
@ -1,5 +1,7 @@
|
||||||
module FactoryGirl
|
module FactoryGirl
|
||||||
class Evaluator
|
class Evaluator
|
||||||
|
undef_method(:id) if method_defined?(:id)
|
||||||
|
|
||||||
def initialize(build_strategy, overrides = {}, callbacks = [])
|
def initialize(build_strategy, overrides = {}, callbacks = [])
|
||||||
@build_strategy = build_strategy
|
@build_strategy = build_strategy
|
||||||
@overrides = overrides
|
@overrides = overrides
|
||||||
|
@ -18,14 +20,6 @@ module FactoryGirl
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def id
|
|
||||||
if @cached_attributes.key?(:id)
|
|
||||||
@cached_attributes[:id]
|
|
||||||
else
|
|
||||||
super
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def __overrides
|
def __overrides
|
||||||
@overrides
|
@overrides
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue