# File lib/factory_girl/step_definitions.rb, line 12 12: def convert_human_hash_to_attribute_hash(human_hash, associations = []) 13: human_hash.inject({}) do |attribute_hash, (human_key, value)| 14: key = human_key.downcase.gsub(' ', '_').to_sym 15: if association = associations.detect {|association| association.name == key } 16: value = convert_association_string_to_instance(association.factory, value) 17: end 18: attribute_hash.merge(key => value) 19: end 20: end