mirror of
https://github.com/samsonjs/grape_logging.git
synced 2026-03-28 09:25:46 +00:00
AutoFix RuboCop Style/MultilineIfModifier
This commit is contained in:
parent
c1fa224cc2
commit
a95640b31b
2 changed files with 6 additions and 10 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue