Skip to content
Browse files

Clean up method names

  • Loading branch information...
1 parent 105d972 commit 369b4b9dcc09eb0870bc13cd942a3eb4eac04843 @joshuaclayton joshuaclayton committed
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/factory_girl/factory.rb
View
14 lib/factory_girl/factory.rb
@@ -205,7 +205,7 @@ def run(overrides = {})
apply_callbacks
apply_attributes
- apply_remaining_attributes
+ apply_remaining_overrides
proxy.result(@to_create)
end
@@ -221,18 +221,22 @@ def apply_callbacks
def apply_attributes
@attributes.each do |attribute|
if overrides_for_attribute(attribute).any?
- handle_overrides(attribute)
+ handle_attribute_with_overrides(attribute)
else
handle_attribute_without_overrides(attribute)
end
end
end
+ def apply_remaining_overrides
+ @overrides.each { |attr, val| proxy.set(attr, val) }
+ end
+
def overrides_for_attribute(attribute)
@overrides.select { |attr, val| attribute.aliases_for?(attr) }
end
- def handle_overrides(attribute)
+ def handle_attribute_with_overrides(attribute)
overrides_for_attribute(attribute).each do |attr, val|
if attribute.ignored
proxy.set_ignored(attr, val)
@@ -248,10 +252,6 @@ def handle_attribute_without_overrides(attribute)
attribute.add_to(proxy)
end
- def apply_remaining_attributes
- @overrides.each { |attr, val| proxy.set(attr, val) }
- end
-
def proxy
@proxy ||= @proxy_class.new(@build_class)
end

0 comments on commit 369b4b9

Please sign in to comment.
Something went wrong with that request. Please try again.