Exception: Filterameter::DeclarationErrors::FilterScopeArgumentError

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

Overview

# Filter Scope Argument Error

Error FilterScopeArgumentError occurs when a scope used as a filter but does not have either zero or one arument. A conditional scope filter should take zero arguments; other scope filters should take one argument.

Instance Method Summary collapse

Constructor Details

#initialize(model_name, scope_name) ⇒ FilterScopeArgumentError

Returns a new instance of FilterScopeArgumentError.



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

def initialize(model_name, scope_name)
  super("#{model_name} scope '#{scope_name}' takes too many arguments. Scopes for filters can only have either " \
        'zero (conditional scope) or one argument')
end