Skip to content

Commit c98e971

Browse files
authored
[Fix] Ensure that classes automatically excluded from audit logging stay excluded after reloads (#32)
1 parent 9081633 commit c98e971

File tree

3 files changed

+37
-8
lines changed

3 files changed

+37
-8
lines changed

.rubocop_todo.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,30 @@
11
# This configuration was generated by
2-
# `rubocop --auto-gen-config`
3-
# on 2022-04-06 17:45:31 UTC using RuboCop version 1.26.0.
2+
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 99999`
3+
# on 2023-05-19 18:17:27 UTC using RuboCop version 1.51.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9+
# Offense count: 10
10+
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
11+
# SupportedStyles: Gemfile, gems.rb, gemspec
12+
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
13+
Gemspec/DevelopmentDependencies:
14+
Exclude:
15+
- 'journaled.gemspec'
16+
917
# Offense count: 2
1018
RSpec/ExpectInHook:
1119
Exclude:
1220
- 'spec/models/concerns/journaled/changes_spec.rb'
1321

22+
# Offense count: 2
23+
# This cop supports unsafe autocorrection (--autocorrect-all).
24+
RSpec/Rails/TravelAround:
25+
Exclude:
26+
- 'spec/lib/journaled/audit_log_spec.rb'
27+
1428
# Offense count: 2
1529
RSpec/SubjectStub:
1630
Exclude:
@@ -23,3 +37,21 @@ RSpec/VerifiedDoubles:
2337
- 'spec/models/concerns/journaled/actor_spec.rb'
2438
- 'spec/models/journaled/actor_uri_provider_spec.rb'
2539
- 'spec/models/journaled/change_writer_spec.rb'
40+
41+
# Offense count: 1
42+
# This cop supports safe autocorrection (--autocorrect).
43+
Rails/IndexWith:
44+
Exclude:
45+
- 'app/models/journaled/event.rb'
46+
47+
# Offense count: 1
48+
# This cop supports unsafe autocorrection (--autocorrect-all).
49+
Style/CollectionCompact:
50+
Exclude:
51+
- 'app/jobs/journaled/delivery_job.rb'
52+
53+
# Offense count: 1
54+
# This cop supports safe autocorrection (--autocorrect).
55+
Style/RedundantConstantBase:
56+
Exclude:
57+
- 'spec/dummy/config.ru'

lib/journaled/audit_log.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,8 @@ def without_audit_logging
5252
private
5353

5454
def zeitwerk_exclude!(name)
55-
if Object.const_defined?(name)
56-
name.constantize.skip_audit_log
57-
else
58-
Rails.autoloaders.main.on_load(name) { |klass, _path| klass.skip_audit_log }
59-
end
55+
name.constantize.skip_audit_log if Object.const_defined?(name)
56+
Rails.autoloaders.main.on_load(name) { |klass, _path| klass.skip_audit_log }
6057
end
6158

6259
def classic_exclude!(name)

lib/journaled/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Journaled
2-
VERSION = "5.3.0".freeze
2+
VERSION = "5.3.1".freeze
33
end

0 commit comments

Comments
 (0)