Skip to content

Commit

Permalink
[Fix] Ensure that classes automatically excluded from audit logging s…
Browse files Browse the repository at this point in the history
…tay excluded after reloads (#32)
  • Loading branch information
smudge authored May 19, 2023
1 parent 9081633 commit c98e971
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 8 deletions.
36 changes: 34 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-04-06 17:45:31 UTC using RuboCop version 1.26.0.
# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 99999`
# on 2023-05-19 18:17:27 UTC using RuboCop version 1.51.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 10
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
# SupportedStyles: Gemfile, gems.rb, gemspec
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
Gemspec/DevelopmentDependencies:
Exclude:
- 'journaled.gemspec'

# Offense count: 2
RSpec/ExpectInHook:
Exclude:
- 'spec/models/concerns/journaled/changes_spec.rb'

# Offense count: 2
# This cop supports unsafe autocorrection (--autocorrect-all).
RSpec/Rails/TravelAround:
Exclude:
- 'spec/lib/journaled/audit_log_spec.rb'

# Offense count: 2
RSpec/SubjectStub:
Exclude:
Expand All @@ -23,3 +37,21 @@ RSpec/VerifiedDoubles:
- 'spec/models/concerns/journaled/actor_spec.rb'
- 'spec/models/journaled/actor_uri_provider_spec.rb'
- 'spec/models/journaled/change_writer_spec.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Rails/IndexWith:
Exclude:
- 'app/models/journaled/event.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/CollectionCompact:
Exclude:
- 'app/jobs/journaled/delivery_job.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/RedundantConstantBase:
Exclude:
- 'spec/dummy/config.ru'
7 changes: 2 additions & 5 deletions lib/journaled/audit_log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ def without_audit_logging
private

def zeitwerk_exclude!(name)
if Object.const_defined?(name)
name.constantize.skip_audit_log
else
Rails.autoloaders.main.on_load(name) { |klass, _path| klass.skip_audit_log }
end
name.constantize.skip_audit_log if Object.const_defined?(name)
Rails.autoloaders.main.on_load(name) { |klass, _path| klass.skip_audit_log }
end

def classic_exclude!(name)
Expand Down
2 changes: 1 addition & 1 deletion lib/journaled/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Journaled
VERSION = "5.3.0".freeze
VERSION = "5.3.1".freeze
end

0 comments on commit c98e971

Please sign in to comment.