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 class Action < ApplicationRecord
has_paper_trail class_name: 'ActionVersion' has_paper_trail versions: { class_name: 'ActionVersion' }
belongs_to :user belongs_to :user
belongs_to :contact belongs_to :contact

View file

@ -7,9 +7,10 @@ module Versions
attr_accessor :version_loader attr_accessor :version_loader
if WITH_CHILDREN.include?(model_name.name) 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 else
has_paper_trail class_name: "#{model_name}Version" has_paper_trail versions: { class_name: "#{model_name}Version" }
end end
# add creator and updator # add creator and updator

View file

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