mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 13:15:40 +02:00
Pump papertrail version to 6.0.2
This commit is contained in:
parent
ad46e08f32
commit
a18f7b1605
12 changed files with 19 additions and 16 deletions
2
Gemfile
2
Gemfile
|
@ -14,7 +14,7 @@ gem 'pg', '1.2.2'
|
||||||
# 1.8 is for Rails < 5.0
|
# 1.8 is for Rails < 5.0
|
||||||
gem 'ransack', '~> 1.8'
|
gem 'ransack', '~> 1.8'
|
||||||
gem 'validates_email_format_of', '1.6.3' # validates email against RFC 2822 and RFC 3696
|
gem 'validates_email_format_of', '1.6.3' # validates email against RFC 2822 and RFC 3696
|
||||||
gem 'paper_trail', '~> 4.0'
|
gem 'paper_trail', '~> 6.0'
|
||||||
|
|
||||||
# 0.7.3 is the latest for Rails 4.2, however, it is absent on Rubygems server
|
# 0.7.3 is the latest for Rails 4.2, however, it is absent on Rubygems server
|
||||||
# https://github.com/huacnlee/rails-settings-cached/issues/165
|
# https://github.com/huacnlee/rails-settings-cached/issues/165
|
||||||
|
|
|
@ -272,9 +272,8 @@ GEM
|
||||||
nori (2.6.0)
|
nori (2.6.0)
|
||||||
open4 (1.3.4)
|
open4 (1.3.4)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
paper_trail (4.2.0)
|
paper_trail (6.0.2)
|
||||||
activerecord (>= 3.0, < 6.0)
|
activerecord (>= 4.0, < 5.2)
|
||||||
activesupport (>= 3.0, < 6.0)
|
|
||||||
request_store (~> 1.1)
|
request_store (~> 1.1)
|
||||||
pdfkit (0.8.4.1)
|
pdfkit (0.8.4.1)
|
||||||
pg (1.2.2)
|
pg (1.2.2)
|
||||||
|
@ -482,7 +481,7 @@ DEPENDENCIES
|
||||||
minitest (~> 5.14)
|
minitest (~> 5.14)
|
||||||
money-rails
|
money-rails
|
||||||
nokogiri
|
nokogiri
|
||||||
paper_trail (~> 4.0)
|
paper_trail (~> 6.0)
|
||||||
pdfkit
|
pdfkit
|
||||||
pg (= 1.2.2)
|
pg (= 1.2.2)
|
||||||
pry (= 0.10.1)
|
pry (= 0.10.1)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
check_authorization unless: :devise_controller?
|
check_authorization unless: :devise_controller?
|
||||||
|
before_action :set_paper_trail_whodunnit
|
||||||
|
|
||||||
# Prevent CSRF attacks by raising an exception.
|
# Prevent CSRF attacks by raising an exception.
|
||||||
# For APIs, you may want to use :null_session instead.
|
# For APIs, you may want to use :null_session instead.
|
||||||
|
|
|
@ -2,6 +2,7 @@ module Epp
|
||||||
class DomainsController < BaseController
|
class DomainsController < BaseController
|
||||||
before_action :find_domain, only: %i[info renew update transfer delete]
|
before_action :find_domain, only: %i[info renew update transfer delete]
|
||||||
before_action :find_password, only: %i[info update transfer delete]
|
before_action :find_password, only: %i[info update transfer delete]
|
||||||
|
before_action :set_paper_trail_whodunnit
|
||||||
|
|
||||||
def info
|
def info
|
||||||
authorize! :info, @domain
|
authorize! :info, @domain
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
module Epp
|
module Epp
|
||||||
class SessionsController < BaseController
|
class SessionsController < BaseController
|
||||||
skip_authorization_check only: [:hello, :login, :logout]
|
skip_authorization_check only: [:hello, :login, :logout]
|
||||||
|
before_action :set_paper_trail_whodunnit
|
||||||
|
|
||||||
def hello
|
def hello
|
||||||
render_epp_response('greeting')
|
render_epp_response('greeting')
|
||||||
|
|
|
@ -55,7 +55,7 @@ module Versions
|
||||||
|
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
def all_versions_for(ids, time)
|
def all_versions_for(ids, time)
|
||||||
ver_klass = paper_trail_version_class
|
ver_klass = paper_trail.version_class
|
||||||
from_history = ver_klass.where(item_id: ids.to_a).
|
from_history = ver_klass.where(item_id: ids.to_a).
|
||||||
order(:item_id).
|
order(:item_id).
|
||||||
preceding(time + 1, true).
|
preceding(time + 1, true).
|
||||||
|
|
1
config/initializers/paper_trail.rb
Normal file
1
config/initializers/paper_trail.rb
Normal file
|
@ -0,0 +1 @@
|
||||||
|
PaperTrail.config.track_associations = false
|
|
@ -25,7 +25,7 @@ class RegistrantApiRegistryLocksTest < ApplicationIntegrationTest
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_locking_a_domain_creates_a_version_record
|
def test_locking_a_domain_creates_a_version_record
|
||||||
assert_difference '@domain.versions.count', 1 do
|
assert_difference '@domain.versions.count', 2 do
|
||||||
post '/api/v1/registrant/domains/2df2c1a1-8f6a-490a-81be-8bdf29866880/registry_lock',
|
post '/api/v1/registrant/domains/2df2c1a1-8f6a-490a-81be-8bdf29866880/registry_lock',
|
||||||
headers: @auth_headers
|
headers: @auth_headers
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@ class ContactAuditLogTest < ActionDispatch::IntegrationTest
|
||||||
contact = contacts(:john)
|
contact = contacts(:john)
|
||||||
|
|
||||||
contact.legal_document_id = 1
|
contact.legal_document_id = 1
|
||||||
assert_difference 'contact.versions.count' do
|
assert_difference 'contact.versions.count', 2 do
|
||||||
contact.save!
|
contact.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ class DomainAuditLogTest < ActionDispatch::IntegrationTest
|
||||||
assert_equal registrant_id, domain.registrant_id
|
assert_equal registrant_id, domain.registrant_id
|
||||||
domain.legal_document_id = legal_document_id
|
domain.legal_document_id = legal_document_id
|
||||||
|
|
||||||
assert_difference 'domain.versions.count' do
|
assert_difference 'domain.versions.count', 2 do
|
||||||
domain.save!
|
domain.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ class PaperTrailLearningTest < ActiveSupport::TestCase
|
||||||
@record = Post.create!(title: 'any')
|
@record = Post.create!(title: 'any')
|
||||||
|
|
||||||
assert_difference -> { @record.versions.size } do
|
assert_difference -> { @record.versions.size } do
|
||||||
@record.touch_with_version
|
@record.paper_trail.touch_with_version
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
|
@ -17,7 +17,7 @@ class DomainVersionTest < ActiveSupport::TestCase
|
||||||
duplicate_domain = prepare_duplicate_domain
|
duplicate_domain = prepare_duplicate_domain
|
||||||
|
|
||||||
PaperTrail.whodunnit = @user.id_role_username
|
PaperTrail.whodunnit = @user.id_role_username
|
||||||
assert_difference 'duplicate_domain.versions.count', 1 do
|
assert_difference 'duplicate_domain.versions.count', 2 do
|
||||||
duplicate_domain.save!
|
duplicate_domain.save!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class DomainVersionTest < ActiveSupport::TestCase
|
||||||
def test_assigns_updator_to_paper_trail_whodunnit
|
def test_assigns_updator_to_paper_trail_whodunnit
|
||||||
PaperTrail.whodunnit = @user.id_role_username
|
PaperTrail.whodunnit = @user.id_role_username
|
||||||
|
|
||||||
assert_difference '@domain.versions.count', 1 do
|
assert_difference '@domain.versions.count', 2 do
|
||||||
@domain.apply_registry_lock
|
@domain.apply_registry_lock
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue