Excuse me for the basic question. I am trying to do tags for a blog post, 
this is what I did:

1. Added a migration for creating the table: posts_tags (Which stores 
post_id and tag_id)
2. Added many_to_many in Post and Tag models.
3. Create a model PostsTags for updating the associating posts_tags table.

It worked well. I was able to retrieve: Post.first.tags to get all the tags 
associated with the first post and vice-versa.

But I am not sure, I had to do the third step? To me, that should have been 
handled automatically? I was assuming an API like this:

Post.new(title: 'Sample Title', body: 'A simple sample blog', tags: 
[Tag.first])

But now, I am depending on PostsTags to add a new tag; is this the expected 
workflow?

-- 
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.

Reply via email to