aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/lib/active_record/relation/query_attribute.rb
blob: 0e1f64775d35cf23188be0304004a1fd667b75cc (plain) (tree)
1
2
3
4
5
                               


                   
                                              













                                             
require_relative "../attribute"

module ActiveRecord
  class Relation
    class QueryAttribute < Attribute # :nodoc:
      def type_cast(value)
        value
      end

      def value_for_database
        @value_for_database ||= super
      end

      def with_cast_value(value)
        QueryAttribute.new(name, value, type)
      end
    end
  end
end