Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在从 Mongoid 2 升级。我有以下模型:
class Person include Mongoid::Document field :names, type: Array end
以下用于引发异常:
p = Person.new p.names = 'stuff'
现在在 Mongoid 3 下,没有引发异常,它默默接受。
如何强制执行数组类型?