也就是说,如果app/models/animal.rb
有
class Animal
include Mongoid::Document
field :name, :type => String
field :birthday, :type => Time
end
然后在app/models/cat.rb
class Cat < Animal
include Mongoid::Document
field :nail_length, :type => Float
end
那么您是否需要在 Animal 中设置某种“类型”以记住它是猫,还是自动的?