Implemented issue #722 - Do not log last_login in user history.
This commit is contained in:
parent
16594b8245
commit
7562cd2dff
2 changed files with 14 additions and 0 deletions
|
@ -63,6 +63,7 @@ class User < ApplicationModel
|
||||||
:preferences
|
:preferences
|
||||||
|
|
||||||
history_attributes_ignored :password,
|
history_attributes_ignored :password,
|
||||||
|
:last_login,
|
||||||
:image,
|
:image,
|
||||||
:image_source,
|
:image_source,
|
||||||
:preferences
|
:preferences
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
class RemoveLastLoginFromHistory722 < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
|
||||||
|
# return if it's a new setup
|
||||||
|
return if !Setting.find_by(name: 'system_init_done')
|
||||||
|
|
||||||
|
history_object = History.object_lookup('User')
|
||||||
|
return if !history_object
|
||||||
|
history_attribute = History.attribute_lookup('last_login')
|
||||||
|
return if !history_attribute
|
||||||
|
History.where(history_object_id: history_object.id, history_attribute_id: history_attribute.id).delete_all
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue