-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
When creating a nested object using
Unable to find source-code formatter for language: update_attributes```. 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
,
after_create
is not called. Example:
rb
class XComment
include Mongoid::Document
field :msg
embedded_in :test_user
after_create do
print 'Should get here Should get here Should get here Should get here Should get here Should get here '
end
end
class TestUser
include Mongoid::Document
embeds_many :x_comments
accepts_nested_attributes_for :x_comments, allow_destroy: true
end
u=TestUser.create!()
Not showing the print
u.update_attributes(x_comments_attributes: [
{msg: 'malicious message'}])
This however works just fine
comment = u.x_comments.create!(msg: 'Hello')
`