thingspeak/app/models/admin_user.rb

19 lines
589 B
Ruby
Raw Normal View History

2014-03-22 18:21:45 +01:00
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