I have a system that occasionally spits out 2 objects. Is there any magic to create! that would allow it to create two objects? E.G. if I say
self.class.create! make_up_attributes
and make_up_attributes passes a 2 item hash, can this create 2 objects of type self?
(note, create is probably an ActiveRecord method, in Rails)
Yep, simply pass in an Array of attribute hashes, like so:
See the docs