2012-05-20 23:30:19 +09:00
|
|
|
class User
|
|
|
|
include ::Mongoid::Document
|
2014-02-02 14:23:46 -05:00
|
|
|
if Mongoid::VERSION > '4.0.0'
|
|
|
|
include Mongoid::Attributes::Dynamic
|
|
|
|
end
|
|
|
|
|
2012-05-20 23:30:19 +09:00
|
|
|
field :name, :type => String
|
|
|
|
field :age, :type => Integer
|
|
|
|
end
|
|
|
|
|
|
|
|
class User::Address
|
|
|
|
include ::Mongoid::Document
|
|
|
|
end
|
|
|
|
|
|
|
|
class MongoMongoidExtensionDeveloper
|
|
|
|
include ::Mongoid::Document
|
|
|
|
field :salary, :type => Integer
|
|
|
|
embeds_many :frameworks
|
|
|
|
end
|
|
|
|
|
|
|
|
class Framework
|
|
|
|
include ::Mongoid::Document
|
|
|
|
field :name, :type => String
|
|
|
|
field :language, :type => String
|
|
|
|
embedded_in :mongo_mongoid_extension_developer
|
|
|
|
end
|