So I have 3 models -
Users, Roles, Records.
For each record X user, can have 1 of 3 roles, and those roles will
give different permissions on each record.
So for example, user 1 - has a role of follower on record 5, also user
1 - is a manager(role) of record 4, etc.
So what I am trying to do, is figure out how to create that
situation.
Would something like this work?
User
has_and_belongs_to roles
has_many records through => role_record

    user_status -- table
      user_id
      status_id

roles
has_and_Belongs_to Users
has_and_belongs_to records

      role_record -- table
        role_id
        record_id
        (user_id)

records
has_and_belongs_to roles

The final goal is I want to call - user(1).role(1) - and have it spit
out all the associated records that I have.

I have n amount of users and records, but currently only 3 roles.
Thanks for the help!

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to