Skip to content

Commit

Permalink
Upgraded to Devise 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam L committed Aug 1, 2012
1 parent b8f51ff commit 27d8873
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 25 deletions.
11 changes: 2 additions & 9 deletions config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
# You can use this to let your user access some features of your application
# without confirming the account, but blocking it after a certain period
# (ie 2 days).
# config.confirm_within = 2.days
# config.allow_unconfirmed_access_for = 2.days

# Defines which key will be used when confirming an account
# config.confirmation_keys = [ :email ]
Expand All @@ -72,15 +72,12 @@
# The time the user will be remembered without asking for credentials again.
# config.remember_for = 2.weeks

# If true, a valid remember token can be re-used between multiple browsers.
# config.remember_across_browsers = true

# If true, extends the user's remember period when remembered via cookie.
# config.extend_remember_period = false

# If true, uses the password salt as remember token. This should be turned
# to false if you are not using database authenticatable.
config.use_salt_as_remember_token = true
# config.use_salt_as_remember_token = true

# Options to be passed to the created cookie. For instance, you can set
# :secure => true in order to force SSL only cookies.
Expand Down Expand Up @@ -143,10 +140,6 @@
# Defines name of the authentication token params key
# config.token_authentication_key = :auth_token

# If true, authentication through token does not store user in session and needs
# to be supplied on each request. Useful if you are using the token as API token.
# config.stateless_token = false

# ==> Scopes configuration
# Turn scoped views on. Before rendering "sessions/new", it will first check for
# "users/sessions/new". It's turned off by default because it's slower if you
Expand Down
7 changes: 3 additions & 4 deletions config/locales/devise.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ en:
send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
confirmed: 'Your account was successfully confirmed. You are now signed in.'
registrations:
signed_up: 'Welcome! You have signed up successfully.'
inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
updated: 'You updated your account successfully.'
destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
unlocks:
send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
unlocked: 'Your account was successfully unlocked. You are now signed in.'
Expand Down
48 changes: 36 additions & 12 deletions db/migrate/20110604131534_devise_create_users.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,43 @@
class DeviseCreateUsers < ActiveRecord::Migration
def self.up
create_table(:users) do |t|
t.database_authenticatable :null => false
t.recoverable
t.rememberable
t.trackable
## Database authenticatable
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""

# t.encryptable
# t.confirmable
# t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
# t.token_authenticatable
## Recoverable
t.string :reset_password_token
t.datetime :reset_password_sent_at

## Rememberable
t.datetime :remember_created_at

## Trackable
t.integer :sign_in_count, :default => 0
t.datetime :current_sign_in_at
t.datetime :last_sign_in_at
t.string :current_sign_in_ip
t.string :last_sign_in_ip

## Encryptable
# t.string :password_salt

## Confirmable
# t.string :confirmation_token
# t.datetime :confirmed_at
# t.datetime :confirmation_sent_at
# t.string :unconfirmed_email # Only if using reconfirmable

## Lockable
# t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
# t.string :unlock_token # Only if unlock strategy is :email or :both
# t.datetime :locked_at

# Token authenticatable
# t.string :authentication_token

## Invitable
# t.string :invitation_token

t.timestamps
end
Expand All @@ -20,8 +48,4 @@ def self.up
# add_index :users, :unlock_token, :unique => true
# add_index :users, :authentication_token, :unique => true
end

def self.down
drop_table :users
end
end

0 comments on commit 27d8873

Please sign in to comment.