summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-06-25 17:50:55 +0200
committererdgeist <erdgeist@erdgeist.org>2026-06-25 17:50:55 +0200
commit26030c71c7b300c30367222f263d74b8d2142ecf (patch)
treecd05051e7bc4e9252b0084f98b7c3df485c8c601 /app/controllers
parent7f26a8202556db3a584f1360950a671d2a60a1ea (diff)
Rails 5.2 application fixes
- 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
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/admin_controller.rb2
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--app/controllers/assets_controller.rb2
-rw-r--r--app/controllers/content_controller.rb2
-rw-r--r--app/controllers/events_controller.rb2
-rw-r--r--app/controllers/menu_items_controller.rb2
-rw-r--r--app/controllers/nodes_controller.rb4
-rw-r--r--app/controllers/occurrences_controller.rb2
-rw-r--r--app/controllers/pages_controller.rb2
-rw-r--r--app/controllers/revisions_controller.rb2
-rw-r--r--app/controllers/rss_controller.rb4
-rw-r--r--app/controllers/tags_controller.rb2
-rw-r--r--app/controllers/users_controller.rb6
13 files changed, 17 insertions, 17 deletions
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
2 2
3 # Private 3 # Private
4 4
5 before_filter :login_required 5 before_action :login_required
6 6
7 def index 7 def index
8 @drafts = Node.where("draft_id IS NOT NULL") 8 @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
6 6
7 protect_from_forgery # See ActionController::RequestForgeryProtection for details 7 protect_from_forgery # See ActionController::RequestForgeryProtection for details
8 8
9 before_filter :set_locale 9 before_action :set_locale
10 10
11 protected 11 protected
12 12
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
2 2
3 # Private 3 # Private
4 4
5 before_filter :login_required 5 before_action :login_required
6 6
7 layout 'admin' 7 layout 'admin'
8 8
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
2 2
3 # Public 3 # Public
4 4
5 before_filter :find_page 5 before_action :find_page
6 6
7 # This is the method that renders most of the the public content. It recieves 7 # This is the method that renders most of the the public content. It recieves
8 # a :locale and a :page_path parameter through the params hash. It looks up 8 # 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
2 2
3 # Private 3 # Private
4 4
5 before_filter :login_required 5 before_action :login_required
6 6
7 layout 'admin' 7 layout 'admin'
8 8
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
2 2
3 # Private 3 # Private
4 4
5 before_filter :login_required 5 before_action :login_required
6 6
7 layout 'admin' 7 layout 'admin'
8 8
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
4 4
5 layout 'admin' 5 layout 'admin'
6 6
7 before_filter :login_required 7 before_action :login_required
8 before_filter :find_node, :only => [ 8 before_action :find_node, :only => [
9 :show, 9 :show,
10 :edit, 10 :edit,
11 :update, 11 :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
2 2
3 # Private 3 # Private
4 4
5 before_filter :login_required 5 before_action :login_required
6 6
7 # GET /occurrences 7 # GET /occurrences
8 # GET /occurrences.xml 8 # 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
2 2
3 # Private 3 # Private
4 4
5 before_filter :login_required 5 before_action :login_required
6 6
7 def preview 7 def preview
8 @page = Page.find(params[:id]) 8 @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
2 2
3 # Private 3 # Private
4 4
5 before_filter :login_required 5 before_action :login_required
6 6
7 layout 'admin' 7 layout 'admin'
8 8
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 @@
1class RssController < ApplicationController 1class RssController < ApplicationController
2 2
3 before_filter :authenticate, :only => :recent_changes 3 before_action :authenticate, :only => :recent_changes
4 before_filter :get_host 4 before_action :get_host
5 5
6 def updates 6 def updates
7 expires_in 31.minutes, :public => true 7 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
35 end 35 end
36 else 36 else
37 respond_to do |format| 37 respond_to do |format|
38 format.html { render :nothing => true, :status => 400 } 38 format.html { head :bad_request }
39 end 39 end
40 end 40 end
41 41
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
2 2
3 # Private 3 # Private
4 4
5 before_filter :login_required 5 before_action :login_required
6 before_filter :find_user, :only => [:show, :edit, :update, :destroy] 6 before_action :find_user, :only => [:show, :edit, :update, :destroy]
7 before_filter :verify_status, :except => [:index, :show] 7 before_action :verify_status, :except => [:index, :show]
8 8
9 layout 'admin' 9 layout 'admin'
10 10