mirror of
https://github.com/redmine/redmine.git
synced 2025-10-26 00:36:14 +02:00
Fixes "ArgumentError: wrong number of arguments (given 0, expected 1) in ApplicationController#find_model_object" in Rails 8 (#43205, #43230).
Patch by Katsuya HIDAKA (user:hidakatsuya). git-svn-id: https://svn.redmine.org/redmine/trunk@24017 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -389,10 +389,6 @@ class ApplicationController < ActionController::Base
|
||||
render_404
|
||||
end
|
||||
|
||||
def self.model_object(model)
|
||||
self.model_object = model
|
||||
end
|
||||
|
||||
# Find the issue whose id is the :id parameter
|
||||
# Raises a Unauthorized exception if the issue is not visible
|
||||
def find_issue
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class CommentsController < ApplicationController
|
||||
self.model_object = News
|
||||
|
||||
default_search_scope :news
|
||||
model_object News
|
||||
before_action :find_model_object
|
||||
before_action :find_project_from_association
|
||||
before_action :authorize
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class DocumentsController < ApplicationController
|
||||
self.model_object = Document
|
||||
|
||||
default_search_scope :documents
|
||||
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]
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class IssueCategoriesController < ApplicationController
|
||||
self.model_object = IssueCategory
|
||||
|
||||
menu_item :settings
|
||||
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]
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class MembersController < ApplicationController
|
||||
model_object Member
|
||||
self.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]
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class NewsController < ApplicationController
|
||||
self.model_object = News
|
||||
|
||||
default_search_scope :news
|
||||
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
|
||||
|
||||
@@ -18,8 +18,9 @@
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
class VersionsController < ApplicationController
|
||||
self.model_object = Version
|
||||
|
||||
menu_item :roadmap
|
||||
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]
|
||||
|
||||
Reference in New Issue
Block a user