aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/predicate_builder/basic_object_handler.rb
blob: 57a8b63001637ebe1a204130476f95bec6aba25e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
module ActiveRecord
  class PredicateBuilder
    class BasicObjectHandler # :nodoc:
      def initialize(predicate_builder)
        @predicate_builder = predicate_builder
      end

      def call(attribute, value)
        value = predicate_builder.type_cast_for_database(attribute.name, value)
        attribute.eq(value)
      end

      protected

      attr_reader :predicate_builder
    end
  end
end