mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-09 14:58:05 -05:00
Avoid datamapper deprecation warnings
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user