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.
Mongoid2からアップグレードしています。次のモデルがあります。
class Person include Mongoid::Document field :names, type: Array end
例外を発生させるために使用されるのは次のとおりです。
p = Person.new p.names = 'stuff'
現在、Mongoid 3では、例外は発生せず、サイレントに受け入れます。
配列型を強制するにはどうすればよいですか?