-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
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