123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::PredicateBuilder::RangeHandler

Do not use. This class is for internal use only.
Relationships & Source Files
Namespace Children
Classes:
Inherits: Object
Defined in: activerecord/lib/active_record/relation/predicate_builder/range_handler.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(predicate_builder) ⇒ RangeHandler

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/range_handler.rb', line 8

def initialize(predicate_builder)
  @predicate_builder = predicate_builder
end

Instance Attribute Details

#predicate_builder (readonly, private)

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/range_handler.rb', line 19

attr_reader :predicate_builder

Instance Method Details

#call(attribute, value)

[ GitHub ]

  
# File 'activerecord/lib/active_record/relation/predicate_builder/range_handler.rb', line 12

def call(attribute, value)
  begin_bind = predicate_builder.build_bind_attribute(attribute.name, value.begin)
  end_bind = predicate_builder.build_bind_attribute(attribute.name, value.end)
  attribute.between(RangeWithBinds.new(begin_bind, end_bind, value.exclude_end?))
end