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

"." in hash key can't be saved into MongoDB

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.1.2
    • Affects Version/s: None
    • Component/s: None
    • None

      Using Mongoid 3.1.1:

      class Testreseller
        include Mongoid::Document
        include Mongoid::MultiParameterAttributes
        field :domain_ip_assoc, type: Hash
      end
      
      @testreseller.domain_ip_assoc = {"one.de"  => "1"}
      @testreseller.save
      

      ... ends in testreseller.domain_ip_assoc not being saved.

      Then changing to:

      @testreseller.domain_ip_assoc = {"one_de"  => "1"}
      @testreseller.save
      

      ... ends in hash being saved into MongoDB.
      But then after changing back to:

      @testreseller.domain_ip_assoc = {"one.de"  => "1"}
      @testreseller.save
      

      ... saves the hash into MongoDB. (..., "domain_ip_assoc" :

      { "one.de" : "1" }

      , ...)

      Thanks a lot.

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

              Created:
              Updated:
              Resolved: