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

Default value on attributes makes the attribute dirty

    • Type: Icon: Task Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      In mongoid 4.0.2

      class Foo
        include Mongoid::Document
        field :bar, default: 1
      end
      

      and then simply run

      > Foo.new.changed?
      => true
      

      This seems like an obvious bug, just because it applies to Foo.new.

            Assignee:
            Unassigned Unassigned
            Reporter:
            darthdeus darthdeus
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: