Class: Caboose::LoginLog
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Caboose::LoginLog
- Defined in:
- app/models/caboose/login_log.rb
Class Method Summary collapse
Class Method Details
.fail_count(user) ⇒ Object
16 17 18 19 20 |
# File 'app/models/caboose/login_log.rb', line 16 def self.fail_count(user) last_successful_login = Caboose::LoginLog.where(:user_id => user.id, :success => true).reorder("date_attempted desc").first id = last_successful_login ? last_successful_login.id : 1 return Caboose::LoginLog.where("user_id = ? and success = ? and id > ?", user.id, false, id).count end |