add ActiveAdmin
This commit is contained in:
18
app/models/admin_user.rb
Normal file
18
app/models/admin_user.rb
Normal file
@ -0,0 +1,18 @@
|
||||
class AdminUser < ActiveRecord::Base
|
||||
# Include default devise modules. Others available are:
|
||||
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
|
||||
devise :database_authenticatable,
|
||||
:recoverable, :rememberable, :trackable, :validatable
|
||||
|
||||
attr_accessor :login
|
||||
|
||||
protected
|
||||
|
||||
def self.find_for_database_authentication(warden_conditions)
|
||||
conditions = warden_conditions.dup
|
||||
login = conditions.delete(:login)
|
||||
where(conditions).where(["lower(email) = :value", { :value => login.strip.downcase }]).first
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user