Skip to content

Commit

Permalink
Memoize the names of attributes to assign for a 33% speed increase on…
Browse files Browse the repository at this point in the history
… factories with overrides
  • Loading branch information
joshuaclayton committed Jul 25, 2012
1 parent 8209a46 commit acb2636
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/factory_girl/attribute_assigner.rb
Expand Up @@ -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
Expand Down

0 comments on commit acb2636

Please sign in to comment.