Ticket #47 (new defect)

Opened 4 months ago

Set scope per user preference?

Reported by: rails Assigned to: jcm
Priority: major Milestone:
Component: doc Version:
Keywords: Cc:

Description

How would I go about setting the scope according to a user preference? I'm using better_nested_set to organize groups as a nested set. Some groups in our system are "archived" using an archived_at datetime field, some are "live." How can I dynamically set the scope for the "groups tree" based on user preference (show me only live groups or only archived groups, or both)?

I'm using acts_as_authenticated and so I thought I might use the very handy current_user method supplied by that plugin, but the session isn't available to the model, so I don't see how I could use that. Any other suggestions?

Thanks, Lowell