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

Localized boolean field with a default value

      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 Durran Jordan
            Reporter:
            did Didier Lafforgue
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: