2009/10/13 Jeremy Evans <[email protected]>:
>> new_model = MyModel.create(model.values.merge(:id => nil))
>
> First, Sequel's defaults will raise an error for that, since it
> doesn't let you to mass assign to the primary key field by default.

new_model = MyModel.create( model.values.reject{|k|k==:id} )

Clive

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to