Sha256: 36db0df78fa2e8c96d46df05d83255bff964e099289524e2fa1fef82f8eb034d

Contents?: true

Size: 1.2 KB

Versions: 7

Compression:

Stored size: 1.2 KB

Contents

module Devise
  module Orm
    # This module contains some helpers and handle schema (migrations):
    #
    #   create_table :accounts do |t|
    #     t.authenticatable
    #     t.confirmable
    #     t.recoverable
    #     t.rememberable
    #     t.timestamps
    #   end
    #
    # However this method does not add indexes. If you need them, here is the declaration:
    #
    #   add_index "accounts", ["email"],                :name => "email",                :unique => true
    #   add_index "accounts", ["confirmation_token"],   :name => "confirmation_token",   :unique => true
    #   add_index "accounts", ["reset_password_token"], :name => "reset_password_token", :unique => true
    #
    module ActiveRecord
      # Required ORM hook. By default, do nothing on ActiveRecord.
      def self.included_modules_hook(klass, modules)
      end

      include Devise::Schema

      # Tell how to apply schema methods.
      def apply_schema(name, type, options={})
        column name, type.to_s.downcase.to_sym, options
      end
    end
  end
end

if defined?(ActiveRecord)
  ActiveRecord::Base.extend Devise::Models
  ActiveRecord::ConnectionAdapters::TableDefinition.send :include, Devise::Orm::ActiveRecord
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
devise-0.5.6 lib/devise/orm/active_record.rb
devise-0.5.5 lib/devise/orm/active_record.rb
devise-0.5.4 lib/devise/orm/active_record.rb
devise-0.5.3 lib/devise/orm/active_record.rb
devise-0.5.2 lib/devise/orm/active_record.rb
devise-0.5.1 lib/devise/orm/active_record.rb
devise-0.5.0 lib/devise/orm/active_record.rb