Sha256: 80c46399837eb894bdea3582838a339b22fddd6ff0288e895aae9f5974f6b538
Contents?: true
Size: 686 Bytes
Versions: 415
Compression:
Stored size: 686 Bytes
Contents
class Caboose::LoginLog < ActiveRecord::Base self.table_name = "login_logs" belongs_to :site, :class_name => 'Caboose::Site' belongs_to :user, :class_name => 'Caboose::User' attr_accessible :id, :site_id , :username , :user_id , :date_attempted , :ip , :success 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 end
Version data entries
415 entries across 415 versions & 1 rubygems