models: stop saving IP addresses in version tables.

Mark various `creator_ip_addr` and `updater_ip_addr` columns as ignored
and stop updating them in preparation for dropping them.
This commit is contained in:
evazion
2022-09-18 03:02:30 -05:00
parent 44d4452068
commit d4da8499ce
28 changed files with 60 additions and 50 deletions

View File

@@ -54,7 +54,7 @@ class Note < ApplicationRecord
end
end
def create_version(updater: CurrentUser.user, updater_ip_addr: CurrentUser.ip_addr)
def create_version(updater: CurrentUser.user)
return unless saved_change_to_versioned_attributes?
if merge_version?(updater.id)
@@ -62,7 +62,7 @@ class Note < ApplicationRecord
else
Note.where(:id => id).update_all("version = coalesce(version, 0) + 1")
reload
create_new_version(updater.id, updater_ip_addr)
create_new_version(updater.id)
end
end
@@ -70,10 +70,9 @@ class Note < ApplicationRecord
new_record? || saved_change_to_x? || saved_change_to_y? || saved_change_to_width? || saved_change_to_height? || saved_change_to_is_active? || saved_change_to_body?
end
def create_new_version(updater_id, updater_ip_addr)
def create_new_version(updater_id)
versions.create(
:updater_id => updater_id,
:updater_ip_addr => updater_ip_addr,
:post_id => post_id,
:x => x,
:y => y,