app/models/pilot.rb
def can?(klass, *actions)
    actions.each do |action|
      if permissions.find_by(model: klass.to_s, action: action).present?
        return true
      end
    end
    false
  end
# Returns true or false whether Pilot has permission to perform
# any supplied action on a model class
#
Returns true or false whether Pilot has permission to perform
any supplied action on a model class
Returns true or false whether Pilot has permission to perform any supplied action on a model class
def can?(klass, *actions)
    actions.each do |action|
      if permissions.find_by(model: klass.to_s, action: action).present?
        return true
      end
    end
    false
  end
def can? ( klass , * actions ) actions . each do | action | if permissions . find_by ( model : klass . to_s , action : action ) . present? return true end end false end
Returns true or false whether Pilot has permission to perform
any supplied action on a model class
Returns true or false whether Pilot has permission to perform any supplied action on a model class
klass
actions