How to do that in protector?
I tried to do that, but with no luck.
if Contractor.restrict!(current_user).can(:create, :kind_cd: 1)
# some view code here
I tried
if user.contractors.any?{ |c| c.kind_cd == 1 }
can :create, kind_cd: lambda { |k| k == 0 }
else
can :create
end
and other, but there isn't any success 😢
Do have protector any similar options?