Active record: is this possible?

Hi,

lets say i have the following model:
i have customers, usergroups and users.

certain users belong to certain groups and access to customer records is
provided on group level. can i do something like:

customer.group.user.find(:all, :conditions “user=?”,session[user])
or someting like that or am i missing the boat completely?

regards,

Remco

Remco Hh wrote:

lets say i have the following model:
i have customers, usergroups and users.

certain users belong to certain groups and access to customer records is
provided on group level. can i do something like:

customer.group.user.find(:all, :conditions “user=?”,session[user])
or someting like that or am i missing the boat completely?

You can probably do something like that. Hard to say for sure without
more info about what your table schemas look like, and just what you are
expecting that find() call to do.


Josh S.
http://blog.hasmanythrough.com

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