hash - Mongoid + Rails + embeds not working -


i have 2 classes in application, paperfield , paper. paper has hash string paperfield named "item_values". when try save paper has paperfield in hash, error returned:

 nomethoderror: undefined method `bson_type' #<paperfield:0x000000066def10> 

these classes:

class paperfield   include mongoid::document   field :value, type: string end   class paper   include mongoid::document   field :item_values, type: hash, default: hash.new # hash (string , paperfield) end 

i used belongs_to didn't work. ideas?


Comments

Popular posts from this blog

python 3 IndexError: list index out of range -

android - How to save instance state of selected radiobutton on menu -

IF statement in MySQL trigger -