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

Add test coverage for symbol round-tripping in Hash field values

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.0.6, 7.1.0
    • Component/s: None
    • Labels:
      None

      Description

      Mongoid round-trips symbol values in hashes:

       
      butler% irb -rmongoid
      irb(main):001:0> Hash.from_bson({foo: :bar}.to_bson)
      => {"foo"=>:bar}
      
      

      This behavior is different from that of bson-ruby:

      butler% irb -rbson
      irb(main):001:0> Hash.from_bson({foo: :bar}.to_bson)
      => {"foo"=>"bar"}
      

      As far as I can see there are no tests for this. This ticket is to add the missing test coverage.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              oleg.pudeyev Oleg Pudeyev
              Reporter:
              oleg.pudeyev Oleg Pudeyev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: