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

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -