Ruby on Rails Sunday, February 16, 2014

Hello everyone!

I have code:

if user.role == "topmanager"
        can :read, ActiveAdmin::Page, :name => "Dashboard" 
        can :manage, Realty, agent: {agency_id: user.agency_id}
...

And I want to add another condition, can :manage, Realty, agent: nil
How to do it? Defining it two times gets error: 

undefined method `reflect_on_association' for Class:Class


How can I define multiple conditions for one ability?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/525650f3-4922-4e5a-b6bf-e898afbcbb99%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment