# File lib/factory_girl/step_definitions.rb, line 2 2: def convert_association_string_to_instance(factory_name, assignment) 3: attribute, value = assignment.split(':', 2) 4: return if value.blank? 5: attributes = convert_human_hash_to_attribute_hash(attribute => value.strip) 6: factory = Factory.factory_by_name(factory_name) 7: model_class = factory.build_class 8: model_class.find(:first, :conditions => attributes) or 9: Factory(factory_name, attributes) 10: end