On Sunday, May 3, 2015 at 5:20:28 PM UTC-7, Jon Mattingly wrote: > > I've looked through the documentation and haven't been able to find out if > this is possible. I found Dataset#import, but that looks like it just takes > actual values. Can you pass an array of Sequel::Model objects into it? I.e. > dataset.import(arr_of_widgets). >
Having Dataset#import handle this would mix the core/model layers, which I generally try to avoid. However, it's simple to just transform the array of objects into an array of hashes and use multi_insert: dataset.multi_insert(arr_of_widgets.map(&:values)) Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
