Module: CanCan::ParameterValidators

Included in:
Rule
Defined in:
lib/cancan/parameter_validators.rb

Instance Method Summary collapse

Instance Method Details

#valid_attribute_param?(attribute) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/cancan/parameter_validators.rb', line 5

def valid_attribute_param?(attribute)
  attribute.nil? || attribute.is_a?(Symbol) || (attribute.is_a?(Array) && attribute.all? { |a| a.is_a?(Symbol) })
end