Fix deprecation issues with has_paper_trail

This commit is contained in:
Karl Erik Õunapuu 2020-06-01 16:11:20 +03:00
parent 602cf78dfe
commit 7580824a38
3 changed files with 7 additions and 5 deletions

View file

@ -1,5 +1,5 @@
class Action < ApplicationRecord
has_paper_trail class_name: 'ActionVersion'
has_paper_trail versions: { class_name: 'ActionVersion' }
belongs_to :user
belongs_to :contact
@ -16,4 +16,4 @@ class Action < ApplicationRecord
raise 'Action object is missing' unless contact
"contact_#{operation}".to_sym
end
end
end

View file

@ -7,9 +7,10 @@ module Versions
attr_accessor :version_loader
if WITH_CHILDREN.include?(model_name.name)
has_paper_trail class_name: "#{model_name}Version", meta: { children: :children_log }
has_paper_trail versions: { class_name: "#{model_name}Version" },
meta: { children: :children_log }
else
has_paper_trail class_name: "#{model_name}Version"
has_paper_trail versions: { class_name: "#{model_name}Version" }
end
# add creator and updator

View file

@ -1,7 +1,8 @@
# Used in Registrant portal to collect registrant verifications
# Registrant postgres user can access this table directly.
class RegistrantVerification < ApplicationRecord
has_paper_trail class_name: 'RegistrantVerificationVersion'
has_paper_trail versions: { class_name: 'RegistrantVerificationVersion' }
# actions
CONFIRMED = 'confirmed'