rails: create Parent, if doesn't exist, whilte creating child record
问题 Any best practices for the following?: I have Manufacturer model that has_many Inventory In my new Inventory form I want a field that maps to Manufacturer.name so that when one submits the new Inventory form the app: searches for a manufacturer with the 'name' from the form if it exists then assign the id to @inventory.manufacturer_id and save @inventory if it doesn't exist then create the manufacturer with the 'name' from the form, assign the id to @inventory.manufacturer_id and save have