CanCanCan has a nice shortcut for managing all models: can :manage, :all and it would be great if this gem had that too, or something similar. I noticed a quick fix that would allow something like this to work:
can :read, ApplicationRecord
In permission.rb:
def matches_subject?(subject)
subject == @subject || subject.class <= @subject
end
Adding .class onto the end of @subject allows the second condition to work successfully. Otherwise, it evaluates to nil.
def matches_subject?(subject)
subject == @subject || subject.class <= @subject.class
end
CanCanCan has a nice shortcut for managing all models:
can :manage, :all
and it would be great if this gem had that too, or something similar. I noticed a quick fix that would allow something like this to work:can :read, ApplicationRecord
In
permission.rb
:Adding
.class
onto the end of@subject
allows the second condition to work successfully. Otherwise, it evaluates tonil
.