开发者

What DataMapper plugin gives :null property option

开发者 https://www.devze.com 2022-12-17 03:54 出处:网络
I\'m trying to adapt a piece of code that has: property :email, String, :index => true, :null => false, :length => 1000

I'm trying to adapt a piece of code that has:

property :email, String, :index => true, :null => false, :length => 1000

in the model definition. I'm getting this error:

ArgumentError: options :null are unknown
 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/开发者_如何学JAVAproperty.rb:901:in `assert_valid_options'
 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/property.rb:811:in `initialize'
 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/model/property.rb:51:in `new'
 from /usr/lib/ruby/gems/1.8/gems/dm-core-0.10.2/lib/dm-core/model/property.rb:51:in `property'

So I think that I'm missing a DataMapper plugin.


I'm not aware of any DataMapper plugin that uses the :null option.

On older versions of DataMapper you'd want to use :nullable => false. The most recent DataMapper (0.10.2) provides the clearer syntax :required => true. The other option is still supported, but is deprecated.

0

精彩评论

暂无评论...
验证码 换一张
取 消