Localized boolean field with a default value

XMLWordPrintableJSON

    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hi, I noticed an unexpected behavior with a localized boolean field.

      A quick example:

      class Person
      include Mongoid::Document
      field :active, type: Boolean, localize: true, default: false
      end

      me = Person.new
      me.active?

      1. returns true instead of false

      This happens here: https://github.com/mongoid/mongoid/blob/master/lib/mongoid/fields.rb#L453

      I will try to send a PR but not sure I'll have time in the next weeks for that.
      Best,

      Did

              Assignee:
              Durran Jordan
              Reporter:
              Didier Lafforgue
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: