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

Atomic Paths error in 3.0.13 with nested classes

      class Task
        include Mongoid::Document 
      
        class Update
          include Mongoid::Document
          embedded_in :task
        end  
      
        embeds_many :updates, class_name: 'Task::Update'
      
      end
      
      Unable to find source-code formatter for language: stacktrace. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      # task.updates.create!(attributes) causes:
      
      undefined method `insert_modifier' for #<Mongoid::Atomic::Paths::Root:0x007fc6a990a908>
      mongoid (3.0.13) lib/mongoid/atomic.rb:147:in `atomic_insert_modifier'
      mongoid (3.0.13) lib/mongoid/persistence/operations.rb:66:in `inserts'
      mongoid (3.0.13) lib/mongoid/persistence/operations/embedded/insert.rb:35:in `block in persist'
      mongoid (3.0.13) lib/mongoid/persistence/insertion.rb:25:in `block (2 levels) in prepare'
      activesupport (3.2.8) lib/active_support/callbacks.rb:425:in `_run__3392240160289786955__create__2671727272121157826__callbacks'
      activesupport (3.2.8) lib/active_support/callbacks.rb:405:in `__run_callback'
      activesupport (3.2.8) lib/active_support/callbacks.rb:385:in `_run_create_callbacks'
      activesupport (3.2.8) lib/active_support/callbacks.rb:81:in `run_callbacks'
      mongoid (3.0.13) lib/mongoid/callbacks.rb:114:in `run_callbacks'
      

      Also tried being more explicit, like this, without effect:

        embedded_in :task, inverse_of: :updates, class_name: 'Update'
        embeds_many :updates, class_name: 'Task::Update', inverse_of: :task 
      

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

              Created:
              Updated:
              Resolved: