|
|
@ -2,11 +2,7 @@ class User < ActiveRecord::Base |
|
|
|
include SentientModel |
|
|
|
include SentientModel |
|
|
|
model_stamper |
|
|
|
model_stamper |
|
|
|
stampable |
|
|
|
stampable |
|
|
|
has_paper_trail ignore: [ |
|
|
|
has_paper_trail |
|
|
|
:updated_at, :sign_in_count, |
|
|
|
|
|
|
|
:last_sign_in_at, :current_sign_in_at, |
|
|
|
|
|
|
|
:last_sign_in_ip, :current_sign_in_ip |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Include default devise modules. Others available are: |
|
|
|
# Include default devise modules. Others available are: |
|
|
|
# :token_authenticatable, :encryptable, :timeoutable and :omniauthable |
|
|
|
# :token_authenticatable, :encryptable, :timeoutable and :omniauthable |
|
|
@ -56,6 +52,13 @@ class User < ActiveRecord::Base |
|
|
|
"#{id} #{email} name:#{full_name} ip:#{current_sign_in_ip} last_ip:#{last_sign_in_ip}" |
|
|
|
"#{id} #{email} name:#{full_name} ip:#{current_sign_in_ip} last_ip:#{last_sign_in_ip}" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# @override |
|
|
|
|
|
|
|
def update_tracked_fields!(*) |
|
|
|
|
|
|
|
self.paper_trail_event = "sign_in" |
|
|
|
|
|
|
|
PaperTrail.whodunnit = to_paper_trail |
|
|
|
|
|
|
|
super |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
delegate :can?, :cannot?, :to => :ability |
|
|
|
delegate :can?, :cannot?, :to => :ability |
|
|
|
|
|
|
|
|
|
|
|
def ability(options = {:reload => false}) |
|
|
|
def ability(options = {:reload => false}) |
|
|
|