class Optometry::Procedures::Recipe::Base embeds_one :final_prescription, class_name: 'Optometry::Prescriptions::Final' end class Optometry::Prescriptions::Final < Optometry::Prescriptions::Base # OculiUterque is a representation of a common structure for our domain # 'base' is a real term for our business domain embeds_one :base, class_name: 'Optometry::Procedures::OculiUterque' embedded_in :examination, class_name: 'Optometry::Procedures::Recipe::Base' end Optometry::Prescriptions::Final.new.base.class # => Optometry::Procedures::Recipe::Base
when I invoke base on the Optometry::Prescriptions::Base instance I expected to receive a Optometry::Procedures::OculiUterque instance. Is it possible that in the future Mongoid put a prefix (like an underscore) for avoiding this scenario in which you have a correct term in the business domain but you can't use it because of a reserved word?, also base, metadata and target seem common words for whatever context you have, my suggestion is to use _base, _metadata or _target instead. Mongoid uses it for inheritance (_type)