source 'https://rubygems.org'
gem 'rails', '~> 3.2.0'
-gem 'devise', '=1.5.2'
+gem 'devise'
+# gem 'devise_token_auth'
gem 'rest-client'
gem 'underscore-rails'
# gem 'backbone-rails'
# Include default devise modules. Others available are:
# , :encryptable, :lockable, :timeoutable and :omniauthable, :confirmable
devise :database_authenticatable, :registerable,
- :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable
+ :recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
- def active_for_authentication?\r
+ def active_for_authentication?
super && (self.approve == 1)
end
# Include default devise modules. Others available are:
# :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
- :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable
-
+ :recoverable, :rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
# Include default devise modules. Others available are:
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
- :recoverable, :rememberable, :trackable, :token_authenticatable, :validatable#, :confirmable
+ :recoverable, :rememberable, :trackable, :validatable#, :confirmable
# Setup accessible (or protected) attributes for your model
attr_accessible :id, :name, :password, :password_confirmation, :remember_me , :email
# note that it will be overwritten if you use your own mailer class with default "from" parameter.
config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com"
config.sign_out_via = :get
-
+ config.secret_key = 'ef21afb7caa18dd6b587e999417c281dbcafdfa132cdb38d08bd4150b763bda62bd5739df69d0d85f514f970608e2efff7fe92a5543ca546ce614ee188bc0177'
# Configure the class responsible to send e-mails.
# config.mailer = "Devise::Mailer"
# 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.
# ==> Configuration for :token_authenticatable
# Defines name of the authentication token params key
-config.token_authentication_key = :auth_token
+# 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.
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.'
reasons:
- inactive: 'inactive'
+ 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.'
unconfirmed: 'unconfirmed'
locked: 'locked'
unlocks:
class DeviseCreateAdmins < ActiveRecord::Migration
def change
create_table(:admins) 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 => ""
+
+ ## 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
# t.encryptable
- t.confirmable
- # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
- t.token_authenticatable
+ ## 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
+
t.integer :approve, :null => false, :default => 0
t.timestamps
class DeviseCreateUsers < ActiveRecord::Migration
def change
create_table(:users) do |t|
- t.database_authenticatable :null => false
- t.recoverable
- t.rememberable
- t.trackable
- t.token_authenticatable
- t.confirmable
+ ## Database authenticatable
+ t.string :email, :null => false, :default => ""
+ t.string :encrypted_password, :null => false, :default => ""
+
+ ## 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
# t.encryptable
- # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
+ ## 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
t.timestamps
class DeviseCreateDemandUsers < ActiveRecord::Migration
def change
create_table(:demand_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 => ""
+
+ ## 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
# t.encryptable
- t.confirmable
- # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
- t.token_authenticatable
+ ## 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
t.timestamps