Use `before_action` instead of `before_filter` for Rails 5.1 compatibility.
This commit is contained in:
parent
1fa228b68c
commit
16c5607fa4
|
@ -56,7 +56,7 @@ module DiscourseChat
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.requires_provider(provider_name)
|
def self.requires_provider(provider_name)
|
||||||
before_filter do
|
before_action do
|
||||||
raise ProviderDisabled.new unless Provider.enabled_provider_names.include?(provider_name)
|
raise ProviderDisabled.new unless Provider.enabled_provider_names.include?(provider_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,9 +2,9 @@ module DiscourseChat::Provider::MattermostProvider
|
||||||
class MattermostCommandController < DiscourseChat::Provider::HookController
|
class MattermostCommandController < DiscourseChat::Provider::HookController
|
||||||
requires_provider ::DiscourseChat::Provider::MattermostProvider::PROVIDER_NAME
|
requires_provider ::DiscourseChat::Provider::MattermostProvider::PROVIDER_NAME
|
||||||
|
|
||||||
before_filter :mattermost_token_valid?, only: :command
|
before_action :mattermost_token_valid?, only: :command
|
||||||
|
|
||||||
skip_before_filter :check_xhr,
|
skip_before_action :check_xhr,
|
||||||
:preload_json,
|
:preload_json,
|
||||||
:verify_authenticity_token,
|
:verify_authenticity_token,
|
||||||
:redirect_to_login_if_required,
|
:redirect_to_login_if_required,
|
||||||
|
|
|
@ -2,10 +2,10 @@ module DiscourseChat::Provider::SlackProvider
|
||||||
class SlackCommandController < DiscourseChat::Provider::HookController
|
class SlackCommandController < DiscourseChat::Provider::HookController
|
||||||
requires_provider ::DiscourseChat::Provider::SlackProvider::PROVIDER_NAME
|
requires_provider ::DiscourseChat::Provider::SlackProvider::PROVIDER_NAME
|
||||||
|
|
||||||
before_filter :slack_token_valid?, only: :command
|
before_action :slack_token_valid?, only: :command
|
||||||
before_filter :slack_payload_token_valid?, only: :interactive
|
before_action :slack_payload_token_valid?, only: :interactive
|
||||||
|
|
||||||
skip_before_filter :check_xhr,
|
skip_before_action :check_xhr,
|
||||||
:preload_json,
|
:preload_json,
|
||||||
:verify_authenticity_token,
|
:verify_authenticity_token,
|
||||||
:redirect_to_login_if_required,
|
:redirect_to_login_if_required,
|
||||||
|
|
|
@ -2,9 +2,9 @@ module DiscourseChat::Provider::TelegramProvider
|
||||||
class TelegramCommandController < DiscourseChat::Provider::HookController
|
class TelegramCommandController < DiscourseChat::Provider::HookController
|
||||||
requires_provider ::DiscourseChat::Provider::TelegramProvider::PROVIDER_NAME
|
requires_provider ::DiscourseChat::Provider::TelegramProvider::PROVIDER_NAME
|
||||||
|
|
||||||
before_filter :telegram_token_valid?, only: :command
|
before_action :telegram_token_valid?, only: :command
|
||||||
|
|
||||||
skip_before_filter :check_xhr,
|
skip_before_action :check_xhr,
|
||||||
:preload_json,
|
:preload_json,
|
||||||
:verify_authenticity_token,
|
:verify_authenticity_token,
|
||||||
:redirect_to_login_if_required,
|
:redirect_to_login_if_required,
|
||||||
|
|
Loading…
Reference in New Issue