Class: Incline::UserLoginHistory

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/incline/user_login_history.rb

Instance Method Summary collapse

Instance Method Details

#date_and_ipObject



15
16
17
# File 'app/models/incline/user_login_history.rb', line 15

def date_and_ip
  "#{created_at.in_time_zone.strftime('%m/%d/%Y')} from #{ip_address}"
end

#time_and_ipObject



11
12
13
# File 'app/models/incline/user_login_history.rb', line 11

def time_and_ip
  "#{created_at.in_time_zone.strftime('%m/%d/%Y %H:%M')} from #{ip_address}"
end

#to_sObject



19
20
21
# File 'app/models/incline/user_login_history.rb', line 19

def to_s
  "Login #{successful ? 'succeeded' : 'failed'} on #{time_and_ip}"
end