Complex Active_record associations

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!

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