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

Make has_attribute? more like ActiveRecord

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.0.0
    • Component/s: None

      Description

      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?

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: