inossidabile / protector

Comfortable (seriously) white-list security restrictions for models on a field level
MIT License
270 stars 31 forks source link

strange issue with can? #5

Closed cj closed 11 years ago

cj commented 11 years ago

Hi,

So in your docs (https://github.com/inossidabile/protector#manual-checks-and-custom-actions) you have model.can?(:drink) # Checks if model can drink any field but when I do that I get wrong number of arguments (1 for 2) (I'm doing User.new.restrict!(current_user).can?(:view)) but if I do User.new.restrict!(current_user).can?(:view, false) things work as expected. Not sure what is going on as you have https://github.com/inossidabile/protector/blob/master/lib/protector/dsl.rb#L164 so it should work. Any ideas?