Relationships

I have a model User who has many Posts
I now want a user to be able to group one of his posts with any posts
from any user.

so i have a Groups model. in the groups database i have:
user_id and post_id

Groups:
has_one :user
has_one :post

Posts:
has_many :groups

so i pull out a post from a user. how can i find what other posts are
grouped to that post?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs