Class: Caboose::LoginLog

Inherits:
ActiveRecord::Base
  • Object
show all
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)
   = Caboose::LoginLog.where(:user_id => user.id, :success => true).reorder("date_attempted desc").first
  id =  ? .id : 1
  return Caboose::LoginLog.where("user_id = ? and success = ? and id > ?", user.id, false, id).count    
end