Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Memoize the names of attributes to assign for a 33% speed increase on…

… factories with overrides
  • Loading branch information...
commit acb263632173f2bc55eb843765cc17bea12645b7 1 parent 8209a46
Joshua Clayton joshuaclayton authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/factory_girl/attribute_assigner.rb
2  lib/factory_girl/attribute_assigner.rb
View
@@ -77,7 +77,7 @@ def attributes_to_set_on_hash
end
def attribute_names_to_assign
- non_ignored_attribute_names + override_names - ignored_attribute_names - alias_names_to_ignore
+ @attribute_names_to_assign ||= non_ignored_attribute_names + override_names - ignored_attribute_names - alias_names_to_ignore
end
def non_ignored_attribute_names
Please sign in to comment.
Something went wrong with that request. Please try again.