Change deprecated *_filter methods to *_action

This commit is contained in:
Patrick Gansterer 2019-10-28 21:11:35 +01:00
parent bee671c90e
commit 2100c738af
39 changed files with 66 additions and 66 deletions

View file

@ -1,8 +1,8 @@
# encoding: utf-8
class CurrentOrders::ArticlesController < ApplicationController
before_filter :authenticate_orders
before_filter :find_order_and_order_article, only: [:index, :show]
before_action :authenticate_orders
before_action :find_order_and_order_article, only: [:index, :show]
def index
# sometimes need to pass id as parameter for forms

View file

@ -1,6 +1,6 @@
class CurrentOrders::GroupOrdersController < ApplicationController
# Security
before_filter :ensure_ordergroup_member
before_action :ensure_ordergroup_member
def index
# XXX code duplication lib/foodsoft_current_orders/app/controllers/current_orders/ordergroups_controller.rb

View file

@ -1,8 +1,8 @@
# encoding: utf-8
class CurrentOrders::OrdergroupsController < ApplicationController
before_filter :authenticate_orders
before_filter :find_group_orders, only: [:index, :show]
before_action :authenticate_orders
before_action :find_group_orders, only: [:index, :show]
def index
# sometimes need to pass id as parameter for forms

View file

@ -1,6 +1,6 @@
class CurrentOrders::OrdersController < ApplicationController
before_filter :authenticate_orders, except: :my
before_action :authenticate_orders, except: :my
def show
@doc_options ||= {}

View file

@ -1,6 +1,6 @@
# encoding: utf-8
class CurrentOrdersController < ApplicationController
before_filter :authenticate_orders
before_action :authenticate_orders
end

View file

@ -1,6 +1,6 @@
class DiscourseController < ApplicationController
before_filter -> { require_plugin_enabled FoodsoftDiscourse }
before_action -> { require_plugin_enabled FoodsoftDiscourse }
protected

View file

@ -1,7 +1,7 @@
class DiscourseLoginController < DiscourseController
before_filter -> { require_config_disabled :discourse_sso }
skip_before_filter :authenticate
before_action -> { require_config_disabled :discourse_sso }
skip_before_action :authenticate
def initiate
discourse_url = FoodsoftConfig[:discourse_url]

View file

@ -1,6 +1,6 @@
class DiscourseSsoController < DiscourseController
before_filter -> { require_config_enabled :discourse_sso }
before_action -> { require_config_enabled :discourse_sso }
def sso
raise I18n.t('discourse.sso.invalid_signature') unless valid_signature?

View file

@ -1,7 +1,7 @@
require 'filemagic'
class DocumentsController < ApplicationController
before_filter -> { require_plugin_enabled FoodsoftDocuments }
before_action -> { require_plugin_enabled FoodsoftDocuments }
def index
if params["sort"]

View file

@ -1,6 +1,6 @@
class MessageThreadsController < ApplicationController
before_filter -> { require_plugin_enabled FoodsoftMessages }
before_action -> { require_plugin_enabled FoodsoftMessages }
def index
@groups = Group.order(:name)

View file

@ -1,6 +1,6 @@
class MessagesController < ApplicationController
before_filter -> { require_plugin_enabled FoodsoftMessages }
before_action -> { require_plugin_enabled FoodsoftMessages }
# Renders the "inbox" action.
def index

View file

@ -2,9 +2,9 @@ class PrinterController < ApplicationController
include Concerns::SendOrderPdf
include Tubesock::Hijack
skip_before_filter :authenticate
before_filter :authenticate_printer
before_filter -> { require_plugin_enabled FoodsoftPrinter }
skip_before_action :authenticate
before_action :authenticate_printer
before_action -> { require_plugin_enabled FoodsoftPrinter }
def socket
hijack do |tubesock|

View file

@ -1,7 +1,7 @@
class PrinterJobsController < ApplicationController
include Concerns::SendOrderPdf
before_filter -> { require_plugin_enabled FoodsoftPrinter }
before_action -> { require_plugin_enabled FoodsoftPrinter }
def index
jobs = PrinterJob.includes(:printer_job_updates)

View file

@ -10,7 +10,7 @@ module FoodsoftUservoice
module LoadUservoice
def self.included(base) # :nodoc:
base.class_eval do
before_filter :add_uservoice_script
before_action :add_uservoice_script
protected

View file

@ -1,13 +1,13 @@
# encoding: utf-8
class PagesController < ApplicationController
before_filter -> { require_plugin_enabled FoodsoftWiki }
before_filter :catch_special_pages, only: [:show, :new]
before_action -> { require_plugin_enabled FoodsoftWiki }
before_action :catch_special_pages, only: [:show, :new]
skip_before_filter :authenticate, :only => :all
before_filter :only => :all do
skip_before_action :authenticate, :only => :all
before_action :only => :all do
authenticate_or_token(['wiki', 'all'])
end
before_filter do
before_action do
content_for :head, view_context.rss_meta_tag
end