Class: Filterameter::Filters::ArelFilter

Inherits:
Object
  • Object
show all
Includes:
Errors, AttributeValidator
Defined in:
lib/filterameter/filters/arel_filter.rb

Overview

# Arel Filter

Class ArelFilter is a base class for arel queries. It does not implement ‘apply`.

Direct Known Subclasses

MaximumFilter, MinimumFilter

Instance Attribute Summary

Attributes included from Errors

#errors

Instance Method Summary collapse

Methods included from Errors

#valid?

Constructor Details

#initialize(model, attribute_name) ⇒ ArelFilter

Returns a new instance of ArelFilter.



13
14
15
16
# File 'lib/filterameter/filters/arel_filter.rb', line 13

def initialize(model, attribute_name)
  @attribute_name = attribute_name
  @arel_attribute = model.arel_table[attribute_name]
end