Changes on BigDecimal field

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Unknown
    • 9.1.0, 9.0.9
    • Affects Version/s: 9.0.7
    • Component/s: None
    • None
    • 🔵 Done
    • Ruby Drivers
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Hi,

      I have a model with a field :value, type: BigDecimal, and I'm enabling 
      map_big_decimal_to_decimal128, and I see some strange behavior of dirty tracking:
       
      $ p.value
      => 0.163482022e3
      $ p.value.class
      => BigDecimal
      $ p.value.to_s
      => "163.482022"
      $ p.value = 163.482022
      => 163.482022
      $ p.value_changed?
      => true
      $ p.changes
      => {"value"=>["163.482022", BSON::Decimal128('163.482022')]}
      $ p.value == p.value_was
      => false

            Assignee:
            Jamis Buck
            Reporter:
            Marek Stanczyk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: