diff --git a/lib/telegram/bot/updates_controller.rb b/lib/telegram/bot/updates_controller.rb index 571b701..ae7528d 100644 --- a/lib/telegram/bot/updates_controller.rb +++ b/lib/telegram/bot/updates_controller.rb @@ -63,7 +63,7 @@ module Telegram include AbstractController::Callbacks # Redefine callbacks with default terminator. - if ActiveSupport.gem_version >= Gem::Version.new('5') + if ActiveSupport::VERSION::MAJOR >= 5 define_callbacks :process_action, skip_after_callbacks_if_terminated: true else diff --git a/spec/telegram/bot/updates_controller_spec.rb b/spec/telegram/bot/updates_controller_spec.rb index f498efd..04e6a5c 100644 --- a/spec/telegram/bot/updates_controller_spec.rb +++ b/spec/telegram/bot/updates_controller_spec.rb @@ -225,12 +225,12 @@ RSpec.describe Telegram::Bot::UpdatesController do it { should change(controller, :acted).to true } its(:call) { should eq [nil, nil, args] } - context 'when callback returns false' do + context 'when callback halts chain' do before do controller_class.prepend(Module.new do def hook super - false + ActiveSupport::VERSION::MAJOR >= 5 ? throw(:abort) : false end end) end