Module: Devise::Orm::Sequel::Schema

Includes:
Schema
Defined in:
lib/devise/orm/sequel/schema.rb

Constant Summary collapse

SCHEMA_OPTIONS =
{ 
  :limit => :size
  # there's also precision and scale
}

Instance Method Summary collapse

Instance Method Details

#apply_devise_schema(name, type, options = {}) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/devise/orm/sequel/schema.rb', line 16

def apply_devise_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)
  end

  cname = name.to_s.to_sym
  if cname == :email then
    # special case for "authenticable" method to also add 
    # auto incrementing id, since sequel doesn't do this automatically
    primary_key(:id)
  end

  column(cname, type, options)
end