I'm creating an object that when called it will create an database record and I want this function to return the newly created object. This is what I got:
data = {foo: 'foo', bar: 'bar'}Dummy.new(data).save! # trueDummy.last # newest record in the database
I'm concerned about what this would mean when there are more than one sessions on the same database. Is there a sure-fire way of getting the record I just created?