aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/lib/active_record/attribute_methods/query.rb
blob: 0154ee35f8c21bd782b7c63e61018803de75d509 (plain) (tree)
1
2
3
4
5
6
7
8
9
10









                                    
                                   









                                         

 
module ActiveRecord
  module AttributeMethods
    module Query
      extend ActiveSupport::Concern

      included do
        attribute_method_suffix "?"
      end

      def query_attribute(attr_name)
        _attributes.has?(attr_name)
      end

      private
        # Handle *? for method_missing.
        def attribute?(attribute_name)
          query_attribute(attribute_name)
        end
    end
  end
end