From 3c0f70ca488325aacd9a374ff9c6c1f38762f8e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20B=C4=82LTEANU?= Date: Sun, 21 Sep 2025 23:05:07 +0300 Subject: [PATCH] Fixes wrong number of arguments (given 0, expected 1) in ApplicationController#find_model_object by renaming self.model_object method to self.set_model_object (#43230). diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a01d5c75f..2327aa781 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -389,7 +389,7 @@ class ApplicationController < ActionController::Base render_404 end - def self.model_object(model) + def self.set_model_object(model) self.model_object = model end diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 4043db08b..963686d4f 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -19,7 +19,7 @@ class CommentsController < ApplicationController default_search_scope :news - model_object News + set_model_object News before_action :find_model_object before_action :find_project_from_association before_action :authorize diff --git a/app/controllers/documents_controller.rb b/app/controllers/documents_controller.rb index bd6c3f461..dbb2cf9cd 100644 --- a/app/controllers/documents_controller.rb +++ b/app/controllers/documents_controller.rb @@ -19,7 +19,7 @@ class DocumentsController < ApplicationController default_search_scope :documents - model_object Document + set_model_object Document before_action :find_project_by_project_id, :only => [:index, :new, :create] before_action :find_model_object, :except => [:index, :new, :create] before_action :find_project_from_association, :except => [:index, :new, :create] diff --git a/app/controllers/issue_categories_controller.rb b/app/controllers/issue_categories_controller.rb index 6148fe663..137923073 100644 --- a/app/controllers/issue_categories_controller.rb +++ b/app/controllers/issue_categories_controller.rb @@ -19,7 +19,7 @@ class IssueCategoriesController < ApplicationController menu_item :settings - model_object IssueCategory + set_model_object IssueCategory before_action :find_model_object, :except => [:index, :new, :create] before_action :find_project_from_association, :except => [:index, :new, :create] before_action :find_project_by_project_id, :only => [:index, :new, :create] diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 3f7b376c6..690ef3e02 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -18,7 +18,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class MembersController < ApplicationController - model_object Member + set_model_object Member before_action :find_model_object, :except => [:index, :new, :create, :autocomplete] before_action :find_project_from_association, :except => [:index, :new, :create, :autocomplete] before_action :find_project_by_project_id, :only => [:index, :new, :create, :autocomplete] diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index dd6bade24..06fc36c60 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -19,7 +19,7 @@ class NewsController < ApplicationController default_search_scope :news - model_object News + set_model_object News before_action :find_model_object, :except => [:new, :create, :index] before_action :find_project_from_association, :except => [:new, :create, :index] before_action :find_project_by_project_id, :only => :create diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 328d3e56e..2d6e8627d 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -19,7 +19,7 @@ class VersionsController < ApplicationController menu_item :roadmap - model_object Version + set_model_object Version before_action :find_model_object, :except => [:index, :new, :create, :close_completed] before_action :find_project_from_association, :except => [:index, :new, :create, :close_completed] before_action :find_project_by_project_id, :only => [:index, :new, :create, :close_completed] -- 2.50.1 (Apple Git-155)