0

To me it appears a nested one-to-many relationship.

Alexander Suraphel
  • 10,103
  • 10
  • 55
  • 90

1 Answers1

2

example: post has_many tags through taggings. (and tags have_many posts through taggings)

So, a post can be assigned to multiple tags:

@post << tag_one
@post << tag_two

And each tag can have many posts:

@tag.posts #=> [post_one, post_two]

The taggings table likely looks like

id, post_id, tag_id

There you go!

So, since both post and tag can have many of the other, many-many

Jesse Wolgamott
  • 40,197
  • 4
  • 83
  • 109