Permalink
Browse files

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

… factories with overrides
  • Loading branch information...
1 parent 8209a46 commit acb263632173f2bc55eb843765cc17bea12645b7 @joshuaclayton joshuaclayton committed Jul 25, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/factory_girl/attribute_assigner.rb
View
2 lib/factory_girl/attribute_assigner.rb
@@ -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

0 comments on commit acb2636

Please sign in to comment.