Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elsif(oas[obj_attr].attr_type == "reference")
- item[obj_attr] = oas[obj_attr].ref_class.constantize.find_or_create(oas[obj_attr].ref_attr, row[index].to_s)
- end
- def find_or_create(attribute, value, user)
- c = Country.find(:first, :conditions => attribute + "='" + value + "'")
- c = Country.create(attribute.to_sym => value, :created_by => user, :updated_by => user, :owner => user) unless c
- return c
- end
Add Comment
Please, Sign In to add comment