Avoid datamapper deprecation warnings

This commit is contained in:
snusnu
2010-02-24 01:38:47 +08:00
committed by José Valim
parent e6f3034b11
commit a12ca2955f

View File

@@ -15,16 +15,16 @@ module Devise
include Devise::Schema
SCHEMA_OPTIONS = {
:null => :nullable,
:null => :required,
:limit => :length
}
# Tell how to apply schema methods. This automatically maps :limit to
# :length and :null to :nullable.
# :length and :null to :required.
def apply_schema(name, type, options={})
SCHEMA_OPTIONS.each do |old_key, new_key|
next unless options.key?(old_key)
options[new_key] = options.delete(old_key)
options[new_key] = !options.delete(old_key)
end
property name, type, options