From 90f0072f84267dbddc0fc08ad66a8f014c1dc938 Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Sat, 5 May 2012 00:49:04 -0400 Subject: [PATCH] Don't outline behavior with the method name --- lib/factory_girl/evaluator.rb | 4 ++-- lib/factory_girl/evaluator_class_definer.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/factory_girl/evaluator.rb b/lib/factory_girl/evaluator.rb index 1f23f72..c093d36 100644 --- a/lib/factory_girl/evaluator.rb +++ b/lib/factory_girl/evaluator.rb @@ -13,7 +13,7 @@ module FactoryGirl end end - def self.define_cached_attribute(name, &block) + def self.define_attribute(name, &block) define_method(name) do if @cached_attributes.key?(name) @cached_attributes[name] @@ -34,7 +34,7 @@ module FactoryGirl @cached_attributes = overrides @overrides.each do |name, value| - singleton_class.define_cached_attribute(name) { value } + singleton_class.define_attribute(name) { value } end end diff --git a/lib/factory_girl/evaluator_class_definer.rb b/lib/factory_girl/evaluator_class_definer.rb index f86080f..ad4768d 100644 --- a/lib/factory_girl/evaluator_class_definer.rb +++ b/lib/factory_girl/evaluator_class_definer.rb @@ -5,7 +5,7 @@ module FactoryGirl @attributes = attributes attributes.each do |attribute| - evaluator_class.define_cached_attribute(attribute.name, &attribute.to_proc) + evaluator_class.define_attribute(attribute.name, &attribute.to_proc) end end