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

Cloning with

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.4
    • Component/s: None
    • Labels:
      None

      Description

      Cloning a document that has an embedded relationship with a localized field is broken

      class Inner
        include Mongoid::Document
       
        field :name, localize: true
      end
       
      class Outer
        include Mongoid::Document
       
        embeds_many :inners
      end
       
      outer = Outer.new(inners: [name: 'test'])
      copy = outer.clone
      puts copy.inners.first.name
      $> {"en"=>"test"}
      

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: