# encoding: utf-8 module Mongoid module Max module Denormalize class OneToMany < Base def attach fields.each do |field| field_meta = meta.klass.fields[field.to_s] klass.field "#{relation}_#{field}", type: field_meta.try(:type) end callback_code = <