Hello ru_ghetto, Welcome to Sequel! I hope you are satisfied with what you've seen so far.
I believe what you are looking for can be found here http://sequel.rubyforge.org/rdoc/classes/Sequel/Model/Associations.html. exploid On Jan 3, 3:27 am, ru_ghetto <[email protected]> wrote: > Hi > > I just started looking into Sequel, am starting a little project with > it and had some questions. Specifically I am wondering about adding > records to established model associations: > > 1) Is there anyway to add new records to an association? Using the > hackneyed blog metaphor, we could have a Post model with > many_to_one :author > Could you add an author object via Post.first.author = Author.new > ( pararms ... ) > I haven't seen anything in documentation that indicates this is > possible. I have done some experimenting and looked in the specs too. > > 2) With many_to_many relationships using a specified join_table, > should a call like ... Post.first.comments << Comment.create > ( params ...) also create a record in the join table. It isn't yet > working out that way for me and my Sequel experiments. I know it is > possible to add private methods related to the associations for adding > and destroying records, but I wasn't sure if that should already be > happening with a many_to_many with a join_table. > > Thanks in advance for the information --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
