From 661b3d8749ad593e2cf544bce3a4758f2e2fd21c Mon Sep 17 00:00:00 2001 From: Andrey Novikov Date: Tue, 31 May 2022 14:09:07 +0300 Subject: [PATCH] Restrict minimum Rails version to 6.1 Response object is available in `process_action.action_controller` event notification only since Ruby on Rails 6.1 --- io_monitor.gemspec | 3 +-- lib/io_monitor/controller.rb | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/io_monitor.gemspec b/io_monitor.gemspec index 8f4fa47..836f5c8 100644 --- a/io_monitor.gemspec +++ b/io_monitor.gemspec @@ -31,7 +31,6 @@ Gem::Specification.new do |spec| spec.required_ruby_version = ">= 2.6.0" - rails_version = ENV["RAILS_VERSION"] || ">= 6.0" - spec.add_dependency "rails", rails_version + spec.add_dependency "rails", ">= 6.1" spec.add_development_dependency "redis", ">= 4.0" end diff --git a/lib/io_monitor/controller.rb b/lib/io_monitor/controller.rb index 065246d..d821c9e 100644 --- a/lib/io_monitor/controller.rb +++ b/lib/io_monitor/controller.rb @@ -21,7 +21,7 @@ def append_info_to_payload(payload) data[source] = IoMonitor.aggregator.get(source) end - data[:response] = payload[:response]&.body&.bytesize || 0 + data[:response] = payload[:response].body.bytesize end end end