Sha256: aca249bf1d63e9ced891b5b20e8c811c0c634f6bbb885aca3cd76aaff912faa5

Contents?: true

Size: 648 Bytes

Versions: 160

Compression:

Stored size: 648 Bytes

Contents

# frozen_string_literal: true

module ActiveRecord
  class PredicateBuilder
    class RangeHandler # :nodoc:
      RangeWithBinds = Struct.new(:begin, :end, :exclude_end?)

      def initialize(predicate_builder)
        @predicate_builder = predicate_builder
      end

      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

      private
        attr_reader :predicate_builder
    end
  end
end

Version data entries

160 entries across 155 versions & 14 rubygems

Version Path
activerecord-7.1.3.4 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.0.8.4 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-6.1.7.8 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.2.0.beta1 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.1.3.2 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.1.3.1 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.0.8.1 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-6.1.7.7 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.1.3 lib/active_record/relation/predicate_builder/range_handler.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/predicate_builder/range_handler.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activerecord-7.0.3.1/lib/active_record/relation/predicate_builder/range_handler.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/activerecord-7.0.2.3/lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.1.2 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.1.1 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.1.0 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.1.0.rc2 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.1.0.rc1 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.1.0.beta1 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.0.8 lib/active_record/relation/predicate_builder/range_handler.rb
activerecord-7.0.7.2 lib/active_record/relation/predicate_builder/range_handler.rb