Exception: Filterameter::DeclarationErrors::NoSuchAttributeError

Inherits:
DeclarationError
  • Object
show all
Defined in:
lib/filterameter/declaration_errors/no_such_attribute_error.rb

Overview

# No Such Attribute Error

Error NoSuchAttributeError occurs when a filter or sort references an attribute that does not exist on the model. The most likely case of this is a typo. Note that if the typo was supposed to reference a scope, this error is added as attributes are assumed when no matching scopes are found.

Instance Method Summary collapse

Constructor Details

#initialize(model_name, attribute_name) ⇒ NoSuchAttributeError

Returns a new instance of NoSuchAttributeError.



11
12
13
# File 'lib/filterameter/declaration_errors/no_such_attribute_error.rb', line 11

def initialize(model_name, attribute_name)
  super("Attribute '#{attribute_name}' does not exist on #{model_name}")
end