-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: 5.1.0
-
Component/s: None
-
None
I have a model called Block, which embeds {{Field}}s.
But when I define embeds_many :fields it breaks with a somewhat unclear error:
irb(main):020:0> Block.new() TypeError: no implicit conversion of String into Integer from .../lib/mongoid/relations/proxy.rb:150:in `[]' from .../lib/mongoid/relations/proxy.rb:150:in `method_missing' from .../lib/mongoid/relations/embedded/many.rb:406:in `method_missing' from .../lib/mongoid/fields.rb:102:in `apply_default' from .../lib/mongoid/fields.rb:74:in `block in apply_pre_processed_defaults' from .../lib/mongoid/fields.rb:73:in `each' from .../lib/mongoid/fields.rb:73:in `apply_pre_processed_defaults' from .../lib/mongoid/document.rb:108:in `block in initialize' from .../lib/mongoid/threaded/lifecycle.rb:89:in `_building' from .../lib/mongoid/document.rb:104:in `initialize' from (irb):20:in `new' from (irb):20
So I guess fields should be a member of Mongoid.destructive_fields