1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-07 11:25:52 +03:00

fixed controller's callbacks for rails5

Этот коммит содержится в:
Max Melentiev
2016-06-02 20:30:35 +03:00
родитель 93ff9851f6
Коммит 43b519c5e8
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@@ -63,7 +63,7 @@ module Telegram
include AbstractController::Callbacks include AbstractController::Callbacks
# Redefine callbacks with default terminator. # Redefine callbacks with default terminator.
if ActiveSupport.gem_version >= Gem::Version.new('5') if ActiveSupport::VERSION::MAJOR >= 5
define_callbacks :process_action, define_callbacks :process_action,
skip_after_callbacks_if_terminated: true skip_after_callbacks_if_terminated: true
else else

Просмотреть файл

@@ -225,12 +225,12 @@ RSpec.describe Telegram::Bot::UpdatesController do
it { should change(controller, :acted).to true } it { should change(controller, :acted).to true }
its(:call) { should eq [nil, nil, args] } its(:call) { should eq [nil, nil, args] }
context 'when callback returns false' do context 'when callback halts chain' do
before do before do
controller_class.prepend(Module.new do controller_class.prepend(Module.new do
def hook def hook
super super
false ActiveSupport::VERSION::MAJOR >= 5 ? throw(:abort) : false
end end
end) end)
end end