aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/predicate_builder/class_handler.rb
blob: 3fe1642ed0ba8da6b93429ce58c3acb61b441aae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module ActiveRecord
  class PredicateBuilder
    class ClassHandler # :nodoc:
      def call(attribute, value)
        print_deprecation_warning
        attribute.eq(value.name)
      end

      private

      def print_deprecation_warning
        ActiveSupport::Deprecation.warn(<<-MSG.squish)
          Passing a class as a value in an Active Record query is deprecated and
          will be removed. Pass a string instead.
        MSG
      end
    end
  end
end