lib/miau/application_policy.rb in miau-1.0.3 vs lib/miau/application_policy.rb in miau-1.1.1
- old
+ new
@@ -2,10 +2,11 @@
class ApplicationPolicy
attr_accessor :user, :resource
def self.miau(actions, meth = nil, &block)
+ kls = name.underscore[0..-8] # remove "_policy"
[actions].flatten.each { |action|
- Miau::PolicyStorage.instance.add(self, action, meth)
+ Miau::PolicyStorage.instance.add_policy(kls, action, meth)
}
end
end