Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-1485

Make has_attribute? more like ActiveRecord

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.0.0
    • Affects Version/s: None
    • Component/s: None

      Presently, has_attribute? is significantly different than what ActiveRecord does. Here is AR's definition:

      1. File activerecord/lib/active_record/base.rb, line 1667
        def has_attribute?(attr_name)
        @attributes.has_key?(attr_name.to_s)
        end

      Currently, has_attribute? is simply an alias to attribute_present?

      def attribute_present?(name)
      attribute = read_attribute(name)
      ! attribute.blank? || attribute == false
      end
      alias :has_attribute? :attribute_present?

            Assignee:
            Unassigned Unassigned
            Reporter:
            mikeycgto Michael Coyne
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: