method

call

Importance_0
v5.0.0.1 - Show latest stable - 0 notes - Class: RangeHandler
call(attribute, value) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/relation/predicate_builder/range_handler.rb, line 10
      def call(attribute, value)
        if value.begin.respond_to?(:infinite?) && value.begin.infinite?
          if value.end.respond_to?(:infinite?) && value.end.infinite?
            attribute.not_in([])
          elsif value.exclude_end?
            attribute.lt(value.end)
          else
            attribute.lteq(value.end)
          end
        elsif value.end.respond_to?(:infinite?) && value.end.infinite?
          attribute.gteq(value.begin)
        elsif value.exclude_end?
          attribute.gteq(value.begin).and(attribute.lt(value.end))
        else
          attribute.between(value)
        end
      end
Register or log in to add new notes.