On Apr 1, 12:55 am, Shawn <[email protected]> wrote: > Sorry, this would have made more sense: > > Is there a way to create multiple records in one record call, such > as: > ItemTag.create_many( > :item_id => 123, > :tag_id => ['new','urgent','important'] > ) > # => > # INSERT INTO item_tags (item_id, tag_id) VALUES > # (123,45), > # (123,67), > # (123,89);
No. You can use import or multi_insert. I would suggest defining your own function that handled the mapping of tag names to ids and then called import or multi_insert. Jeremy -- 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.
