AutoFix RuboCop Style/MultilineIfModifier

This commit is contained in:
Pieter Oliver 2025-07-08 17:20:53 +01:00
parent c1fa224cc2
commit a95640b31b
No known key found for this signature in database
GPG key ID: AAC5BA1478582D1F
2 changed files with 6 additions and 10 deletions

View file

@ -180,12 +180,6 @@ Style/ModuleFunction:
Exclude:
- 'lib/grape_logging/timings.rb'
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
Style/MultilineIfModifier:
Exclude:
- 'lib/grape_logging/middleware/request_logger.rb'
# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: EnforcedStyle.

View file

@ -3,10 +3,12 @@ require 'grape'
module GrapeLogging
module Middleware
class RequestLogger < Grape::Middleware::Base
ActiveSupport::Notifications.subscribe('sql.active_record') do |*args|
event = ActiveSupport::Notifications::Event.new(*args)
GrapeLogging::Timings.append_db_runtime(event)
end if defined?(ActiveRecord)
if defined?(ActiveRecord)
ActiveSupport::Notifications.subscribe('sql.active_record') do |*args|
event = ActiveSupport::Notifications::Event.new(*args)
GrapeLogging::Timings.append_db_runtime(event)
end
end
# Persist response status & response (body)
# to use int in parameters