From 26030c71c7b300c30367222f263d74b8d2142ecf Mon Sep 17 00:00:00 2001 From: erdgeist Date: Thu, 25 Jun 2026 17:50:55 +0200 Subject: Rails 5.2 application fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename before_filter → before_action across all controllers - Fix string conditions in validators to lambda syntax (node.rb) - Fix publish_draft!: move staged slug/parent logic outside draft guard, use move_to_child_of for parent changes, add nil guard for no-op calls - Fix update_unique_names_of_children: use parent_id traversal instead of lft/rgt descendants (awesome_nested_set 3.x lft/rgt update bug) - Fix unique_path to return Array instead of String - Fix Occurrence.delete_all syntax for Rails 5 - Fix Page.find_with_outdated_translations: use includes instead of all - Fix outdated_translations?: use find instead of splat array --- app/controllers/admin_controller.rb | 2 +- app/controllers/application_controller.rb | 2 +- app/controllers/assets_controller.rb | 2 +- app/controllers/content_controller.rb | 2 +- app/controllers/events_controller.rb | 2 +- app/controllers/menu_items_controller.rb | 2 +- app/controllers/nodes_controller.rb | 4 ++-- app/controllers/occurrences_controller.rb | 2 +- app/controllers/pages_controller.rb | 2 +- app/controllers/revisions_controller.rb | 2 +- app/controllers/rss_controller.rb | 4 ++-- app/controllers/tags_controller.rb | 2 +- app/controllers/users_controller.rb | 6 +++--- 13 files changed, 17 insertions(+), 17 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 18c4104..9e8564e 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -2,7 +2,7 @@ class AdminController < ApplicationController # Private - before_filter :login_required + before_action :login_required def index @drafts = Node.where("draft_id IS NOT NULL") diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 4d0ed2e..32c7373 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -6,7 +6,7 @@ class ApplicationController < ActionController::Base protect_from_forgery # See ActionController::RequestForgeryProtection for details - before_filter :set_locale + before_action :set_locale protected diff --git a/app/controllers/assets_controller.rb b/app/controllers/assets_controller.rb index cfaf176..a11bbdd 100644 --- a/app/controllers/assets_controller.rb +++ b/app/controllers/assets_controller.rb @@ -2,7 +2,7 @@ class AssetsController < ApplicationController # Private - before_filter :login_required + before_action :login_required layout 'admin' diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb index 4248239..876bccf 100644 --- a/app/controllers/content_controller.rb +++ b/app/controllers/content_controller.rb @@ -2,7 +2,7 @@ class ContentController < ApplicationController # Public - before_filter :find_page + before_action :find_page # This is the method that renders most of the the public content. It recieves # a :locale and a :page_path parameter through the params hash. It looks up diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 805e941..6eba476 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -2,7 +2,7 @@ class EventsController < ApplicationController # Private - before_filter :login_required + before_action :login_required layout 'admin' diff --git a/app/controllers/menu_items_controller.rb b/app/controllers/menu_items_controller.rb index 24a3d5e..4018693 100644 --- a/app/controllers/menu_items_controller.rb +++ b/app/controllers/menu_items_controller.rb @@ -2,7 +2,7 @@ class MenuItemsController < ApplicationController # Private - before_filter :login_required + before_action :login_required layout 'admin' diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 2b36b78..482d0ac 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb @@ -4,8 +4,8 @@ class NodesController < ApplicationController layout 'admin' - before_filter :login_required - before_filter :find_node, :only => [ + before_action :login_required + before_action :find_node, :only => [ :show, :edit, :update, diff --git a/app/controllers/occurrences_controller.rb b/app/controllers/occurrences_controller.rb index 751be40..61b42ff 100644 --- a/app/controllers/occurrences_controller.rb +++ b/app/controllers/occurrences_controller.rb @@ -2,7 +2,7 @@ class OccurrencesController < ApplicationController # Private - before_filter :login_required + before_action :login_required # GET /occurrences # GET /occurrences.xml diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index a684327..f5609eb 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -2,7 +2,7 @@ class PagesController < ApplicationController # Private - before_filter :login_required + before_action :login_required def preview @page = Page.find(params[:id]) diff --git a/app/controllers/revisions_controller.rb b/app/controllers/revisions_controller.rb index 8c16730..42d667e 100644 --- a/app/controllers/revisions_controller.rb +++ b/app/controllers/revisions_controller.rb @@ -2,7 +2,7 @@ class RevisionsController < ApplicationController # Private - before_filter :login_required + before_action :login_required layout 'admin' diff --git a/app/controllers/rss_controller.rb b/app/controllers/rss_controller.rb index be9cd2c..4b47218 100644 --- a/app/controllers/rss_controller.rb +++ b/app/controllers/rss_controller.rb @@ -1,7 +1,7 @@ class RssController < ApplicationController - before_filter :authenticate, :only => :recent_changes - before_filter :get_host + before_action :authenticate, :only => :recent_changes + before_action :get_host def updates expires_in 31.minutes, :public => true diff --git a/app/controllers/tags_controller.rb b/app/controllers/tags_controller.rb index e4ceec9..bf6a029 100644 --- a/app/controllers/tags_controller.rb +++ b/app/controllers/tags_controller.rb @@ -35,7 +35,7 @@ class TagsController < ApplicationController end else respond_to do |format| - format.html { render :nothing => true, :status => 400 } + format.html { head :bad_request } end end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1d85690..72e6058 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2,9 +2,9 @@ class UsersController < ApplicationController # Private - before_filter :login_required - before_filter :find_user, :only => [:show, :edit, :update, :destroy] - before_filter :verify_status, :except => [:index, :show] + before_action :login_required + before_action :find_user, :only => [:show, :edit, :update, :destroy] + before_action :verify_status, :except => [:index, :show] layout 'admin' -- cgit v1.3