mirror of
https://github.com/redmine/redmine.git
synced 2025-10-26 07:46:17 +01:00
Fix Rubocop Style/ArgumentsForwarding (#42496).
git-svn-id: https://svn.redmine.org/redmine/trunk@23698 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -36,23 +36,23 @@ module IconsHelper
|
||||
end
|
||||
end
|
||||
|
||||
def file_icon(entry, name, **options)
|
||||
def file_icon(entry, name, **)
|
||||
if entry.is_dir?
|
||||
sprite_icon("folder", name, **options)
|
||||
sprite_icon("folder", name, **)
|
||||
else
|
||||
icon_name = icon_for_mime_type(Redmine::MimeType.css_class_of(name))
|
||||
sprite_icon(icon_name, name, **options)
|
||||
sprite_icon(icon_name, name, **)
|
||||
end
|
||||
end
|
||||
|
||||
def principal_icon(principal, **options)
|
||||
def principal_icon(principal, **)
|
||||
raise ArgumentError, "First argument has to be a Principal, was #{principal.inspect}" unless principal.is_a?(Principal)
|
||||
|
||||
principal_class = principal.class.name.downcase
|
||||
sprite_icon('group', **options) if ['groupanonymous', 'groupnonmember', 'group'].include?(principal_class)
|
||||
sprite_icon('group', **) if ['groupanonymous', 'groupnonmember', 'group'].include?(principal_class)
|
||||
end
|
||||
|
||||
def activity_event_type_icon(event_type, **options)
|
||||
def activity_event_type_icon(event_type, **)
|
||||
icon_name = case event_type
|
||||
when 'reply'
|
||||
'comments'
|
||||
@@ -64,7 +64,7 @@ module IconsHelper
|
||||
event_type
|
||||
end
|
||||
|
||||
sprite_icon(icon_name, **options)
|
||||
sprite_icon(icon_name, **)
|
||||
end
|
||||
|
||||
def scm_change_icon(action, name, **options)
|
||||
@@ -79,7 +79,7 @@ module IconsHelper
|
||||
sprite_icon(icon_name, name, size: 14)
|
||||
end
|
||||
|
||||
def notice_icon(type, **options)
|
||||
def notice_icon(type, **)
|
||||
icon_name = case type
|
||||
when 'notice'
|
||||
'checked'
|
||||
@@ -87,7 +87,7 @@ module IconsHelper
|
||||
'warning'
|
||||
end
|
||||
|
||||
sprite_icon(icon_name, **options)
|
||||
sprite_icon(icon_name, **)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -38,27 +38,27 @@ module PrincipalMembershipsHelper
|
||||
end
|
||||
end
|
||||
|
||||
def new_principal_membership_path(principal, *args)
|
||||
def new_principal_membership_path(principal, *)
|
||||
if principal.is_a?(Group)
|
||||
new_group_membership_path(principal, *args)
|
||||
new_group_membership_path(principal, *)
|
||||
else
|
||||
new_user_membership_path(principal, *args)
|
||||
new_user_membership_path(principal, *)
|
||||
end
|
||||
end
|
||||
|
||||
def edit_principal_membership_path(principal, *args)
|
||||
def edit_principal_membership_path(principal, *)
|
||||
if principal.is_a?(Group)
|
||||
edit_group_membership_path(principal, *args)
|
||||
edit_group_membership_path(principal, *)
|
||||
else
|
||||
edit_user_membership_path(principal, *args)
|
||||
edit_user_membership_path(principal, *)
|
||||
end
|
||||
end
|
||||
|
||||
def principal_membership_path(principal, membership, *args)
|
||||
def principal_membership_path(principal, membership, *)
|
||||
if principal.is_a?(Group)
|
||||
group_membership_path(principal, membership, *args)
|
||||
group_membership_path(principal, membership, *)
|
||||
else
|
||||
user_membership_path(principal, membership, *args)
|
||||
user_membership_path(principal, membership, *)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -34,9 +34,9 @@ module ReportsHelper
|
||||
a
|
||||
end
|
||||
|
||||
def aggregate_link(data, criteria, *args)
|
||||
def aggregate_link(data, criteria, *)
|
||||
a = aggregate data, criteria
|
||||
a > 0 ? link_to(h(a), *args) : '-'
|
||||
a > 0 ? link_to(h(a), *) : '-'
|
||||
end
|
||||
|
||||
def aggregate_path(project, field, row, options={})
|
||||
|
||||
@@ -20,83 +20,83 @@
|
||||
module RoutesHelper
|
||||
# Returns the path to project issues or to the cross-project
|
||||
# issue list if project is nil
|
||||
def _project_issues_path(project, *args)
|
||||
def _project_issues_path(project, *)
|
||||
if project
|
||||
project_issues_path(project, *args)
|
||||
project_issues_path(project, *)
|
||||
else
|
||||
issues_path(*args)
|
||||
issues_path(*)
|
||||
end
|
||||
end
|
||||
|
||||
def _project_issues_url(project, *args)
|
||||
def _project_issues_url(project, *)
|
||||
if project
|
||||
project_issues_url(project, *args)
|
||||
project_issues_url(project, *)
|
||||
else
|
||||
issues_url(*args)
|
||||
issues_url(*)
|
||||
end
|
||||
end
|
||||
|
||||
def _project_news_path(project, *args)
|
||||
def _project_news_path(project, *)
|
||||
if project
|
||||
project_news_index_path(project, *args)
|
||||
project_news_index_path(project, *)
|
||||
else
|
||||
news_index_path(*args)
|
||||
news_index_path(*)
|
||||
end
|
||||
end
|
||||
|
||||
def _new_project_issue_path(project, *args)
|
||||
def _new_project_issue_path(project, *)
|
||||
if project
|
||||
new_project_issue_path(project, *args)
|
||||
new_project_issue_path(project, *)
|
||||
else
|
||||
new_issue_path(*args)
|
||||
new_issue_path(*)
|
||||
end
|
||||
end
|
||||
|
||||
def _project_calendar_path(project, *args)
|
||||
project ? project_calendar_path(project, *args) : issues_calendar_path(*args)
|
||||
def _project_calendar_path(project, *)
|
||||
project ? project_calendar_path(project, *) : issues_calendar_path(*)
|
||||
end
|
||||
|
||||
def _project_gantt_path(project, *args)
|
||||
project ? project_gantt_path(project, *args) : issues_gantt_path(*args)
|
||||
def _project_gantt_path(project, *)
|
||||
project ? project_gantt_path(project, *) : issues_gantt_path(*)
|
||||
end
|
||||
|
||||
def _time_entries_path(project, issue, *args)
|
||||
def _time_entries_path(project, issue, *)
|
||||
if project
|
||||
project_time_entries_path(project, *args)
|
||||
project_time_entries_path(project, *)
|
||||
else
|
||||
time_entries_path(*args)
|
||||
time_entries_path(*)
|
||||
end
|
||||
end
|
||||
|
||||
def _report_time_entries_path(project, issue, *args)
|
||||
def _report_time_entries_path(project, issue, *)
|
||||
if project
|
||||
report_project_time_entries_path(project, *args)
|
||||
report_project_time_entries_path(project, *)
|
||||
else
|
||||
report_time_entries_path(*args)
|
||||
report_time_entries_path(*)
|
||||
end
|
||||
end
|
||||
|
||||
def _new_time_entry_path(project, issue, *args)
|
||||
def _new_time_entry_path(project, issue, *)
|
||||
if issue
|
||||
new_issue_time_entry_path(issue, *args)
|
||||
new_issue_time_entry_path(issue, *)
|
||||
elsif project
|
||||
new_project_time_entry_path(project, *args)
|
||||
new_project_time_entry_path(project, *)
|
||||
else
|
||||
new_time_entry_path(*args)
|
||||
new_time_entry_path(*)
|
||||
end
|
||||
end
|
||||
|
||||
# Returns the path to bulk update issues or to issue path
|
||||
# if only one issue is selected for bulk update
|
||||
def _bulk_update_issues_path(issue, *args)
|
||||
def _bulk_update_issues_path(issue, *)
|
||||
if issue
|
||||
issue_path(issue, *args)
|
||||
issue_path(issue, *)
|
||||
else
|
||||
bulk_update_issues_path(*args)
|
||||
bulk_update_issues_path(*)
|
||||
end
|
||||
end
|
||||
|
||||
def board_path(board, *args)
|
||||
project_board_path(board.project, board, *args)
|
||||
def board_path(board, *)
|
||||
project_board_path(board.project, board, *)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -336,12 +336,12 @@ class CustomField < ApplicationRecord
|
||||
args.include?(field_format)
|
||||
end
|
||||
|
||||
def self.human_attribute_name(attribute_key_name, *args)
|
||||
def self.human_attribute_name(attribute_key_name, *)
|
||||
attr_name = attribute_key_name.to_s
|
||||
if attr_name == 'url_pattern'
|
||||
attr_name = "url"
|
||||
end
|
||||
super(attr_name, *args)
|
||||
super(attr_name, *)
|
||||
end
|
||||
|
||||
def css_classes
|
||||
|
||||
@@ -94,12 +94,12 @@ class Group < Principal
|
||||
destroy_all
|
||||
end
|
||||
|
||||
def self.human_attribute_name(attribute_key_name, *args)
|
||||
def self.human_attribute_name(attribute_key_name, *)
|
||||
attr_name = attribute_key_name.to_s
|
||||
if attr_name == 'lastname'
|
||||
attr_name = "name"
|
||||
end
|
||||
super(attr_name, *args)
|
||||
super(attr_name, *)
|
||||
end
|
||||
|
||||
def self.anonymous
|
||||
|
||||
@@ -268,7 +268,7 @@ class Issue < ApplicationRecord
|
||||
end
|
||||
|
||||
alias :base_reload :reload
|
||||
def reload(*args)
|
||||
def reload(*)
|
||||
@workflow_rule_by_attribute = nil
|
||||
@assignable_versions = nil
|
||||
@relations = nil
|
||||
@@ -277,7 +277,7 @@ class Issue < ApplicationRecord
|
||||
@total_estimated_hours = nil
|
||||
@last_updated_by = nil
|
||||
@last_notes = nil
|
||||
base_reload(*args)
|
||||
base_reload(*)
|
||||
end
|
||||
|
||||
# Overrides Redmine::Acts::Customizable::InstanceMethods#available_custom_fields
|
||||
@@ -469,7 +469,7 @@ class Issue < ApplicationRecord
|
||||
end
|
||||
|
||||
# Overrides assign_attributes so that project and tracker get assigned first
|
||||
def assign_attributes(new_attributes, *args)
|
||||
def assign_attributes(new_attributes, *)
|
||||
return if new_attributes.nil?
|
||||
|
||||
attrs = new_attributes.dup
|
||||
@@ -480,7 +480,7 @@ class Issue < ApplicationRecord
|
||||
send :"#{attr}=", attrs.delete(attr)
|
||||
end
|
||||
end
|
||||
super(attrs, *args)
|
||||
super(attrs, *)
|
||||
end
|
||||
|
||||
def attributes=(new_attributes)
|
||||
|
||||
@@ -22,9 +22,9 @@ class IssueRelation < ApplicationRecord
|
||||
class Relations < Array
|
||||
include Redmine::I18n
|
||||
|
||||
def initialize(issue, *args)
|
||||
def initialize(issue, *)
|
||||
@issue = issue
|
||||
super(*args)
|
||||
super(*)
|
||||
end
|
||||
|
||||
def to_s(*args)
|
||||
|
||||
@@ -157,8 +157,8 @@ class Journal < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def visible?(*args)
|
||||
journalized.visible?(*args)
|
||||
def visible?(*)
|
||||
journalized.visible?(*)
|
||||
end
|
||||
|
||||
# Returns a string of css classes
|
||||
|
||||
@@ -55,8 +55,8 @@ class MailHandler < ActionMailer::Base
|
||||
end
|
||||
|
||||
# Receives an email and rescues any exception
|
||||
def self.safe_receive(*args)
|
||||
receive(*args)
|
||||
def self.safe_receive(*)
|
||||
receive(*)
|
||||
rescue => e
|
||||
Rails.logger.error "MailHandler: an unexpected error occurred when receiving email: #{e.message}"
|
||||
return false
|
||||
|
||||
@@ -45,9 +45,9 @@ class Member < ApplicationRecord
|
||||
end)
|
||||
|
||||
alias :base_reload :reload
|
||||
def reload(*args)
|
||||
def reload(*)
|
||||
@managed_roles = nil
|
||||
base_reload(*args)
|
||||
base_reload(*)
|
||||
end
|
||||
|
||||
def role
|
||||
|
||||
@@ -358,12 +358,12 @@ class Project < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def self.find_by_param(*args)
|
||||
self.find(*args)
|
||||
def self.find_by_param(*)
|
||||
self.find(*)
|
||||
end
|
||||
|
||||
alias :base_reload :reload
|
||||
def reload(*args)
|
||||
def reload(*)
|
||||
@principals = nil
|
||||
@users = nil
|
||||
@shared_versions = nil
|
||||
@@ -382,7 +382,7 @@ class Project < ApplicationRecord
|
||||
@override_members = nil
|
||||
@assignable_users = nil
|
||||
@last_activity_date = nil
|
||||
base_reload(*args)
|
||||
base_reload(*)
|
||||
end
|
||||
|
||||
def to_param
|
||||
|
||||
@@ -69,12 +69,12 @@ class Repository < ApplicationRecord
|
||||
end
|
||||
end
|
||||
|
||||
def self.human_attribute_name(attribute_key_name, *args)
|
||||
def self.human_attribute_name(attribute_key_name, *)
|
||||
attr_name = attribute_key_name.to_s
|
||||
if attr_name == "log_encoding"
|
||||
attr_name = "commit_logs_encoding"
|
||||
end
|
||||
super(attr_name, *args)
|
||||
super(attr_name, *)
|
||||
end
|
||||
|
||||
# Removes leading and trailing whitespace
|
||||
@@ -369,8 +369,8 @@ class Repository < ApplicationRecord
|
||||
subclasses.collect {|klass| [klass.scm_name, klass.name]}
|
||||
end
|
||||
|
||||
def self.factory(klass_name, *args)
|
||||
repository_class(klass_name).new(*args) rescue nil
|
||||
def self.factory(klass_name, *)
|
||||
repository_class(klass_name).new(*) rescue nil
|
||||
end
|
||||
|
||||
def self.repository_class(class_name)
|
||||
|
||||
@@ -22,12 +22,12 @@ require 'redmine/scm/adapters/bazaar_adapter'
|
||||
class Repository::Bazaar < Repository
|
||||
validates_presence_of :url, :log_encoding
|
||||
|
||||
def self.human_attribute_name(attribute_key_name, *args)
|
||||
def self.human_attribute_name(attribute_key_name, *)
|
||||
attr_name = attribute_key_name.to_s
|
||||
if attr_name == "url"
|
||||
attr_name = "path_to_repository"
|
||||
end
|
||||
super(attr_name, *args)
|
||||
super(attr_name, *)
|
||||
end
|
||||
|
||||
def self.scm_adapter_class
|
||||
|
||||
@@ -27,14 +27,14 @@ class Repository::Cvs < Repository
|
||||
'root_url',
|
||||
:if => lambda {|repository, user| repository.new_record?})
|
||||
|
||||
def self.human_attribute_name(attribute_key_name, *args)
|
||||
def self.human_attribute_name(attribute_key_name, *)
|
||||
attr_name = attribute_key_name.to_s
|
||||
if attr_name == "root_url"
|
||||
attr_name = "cvsroot"
|
||||
elsif attr_name == "url"
|
||||
attr_name = "cvs_module"
|
||||
end
|
||||
super(attr_name, *args)
|
||||
super(attr_name, *)
|
||||
end
|
||||
|
||||
def self.scm_adapter_class
|
||||
|
||||
@@ -25,12 +25,12 @@ require 'redmine/scm/adapters/filesystem_adapter'
|
||||
class Repository::Filesystem < Repository
|
||||
validates_presence_of :url
|
||||
|
||||
def self.human_attribute_name(attribute_key_name, *args)
|
||||
def self.human_attribute_name(attribute_key_name, *)
|
||||
attr_name = attribute_key_name.to_s
|
||||
if attr_name == "url"
|
||||
attr_name = "root_directory"
|
||||
end
|
||||
super(attr_name, *args)
|
||||
super(attr_name, *)
|
||||
end
|
||||
|
||||
def self.scm_adapter_class
|
||||
|
||||
@@ -25,10 +25,10 @@ class Repository::Git < Repository
|
||||
|
||||
safe_attributes 'report_last_commit'
|
||||
|
||||
def self.human_attribute_name(attribute_key_name, *args)
|
||||
def self.human_attribute_name(attribute_key_name, *)
|
||||
attr_name = attribute_key_name.to_s
|
||||
attr_name = 'path_to_repository' if attr_name == 'url'
|
||||
super(attr_name, *args)
|
||||
super(attr_name, *)
|
||||
end
|
||||
|
||||
def self.scm_adapter_class
|
||||
|
||||
@@ -30,12 +30,12 @@ class Repository::Mercurial < Repository
|
||||
# number of changesets to fetch at once
|
||||
FETCH_AT_ONCE = 100
|
||||
|
||||
def self.human_attribute_name(attribute_key_name, *args)
|
||||
def self.human_attribute_name(attribute_key_name, *)
|
||||
attr_name = attribute_key_name.to_s
|
||||
if attr_name == "url"
|
||||
attr_name = "path_to_repository"
|
||||
end
|
||||
super(attr_name, *args)
|
||||
super(attr_name, *)
|
||||
end
|
||||
|
||||
def self.scm_adapter_class
|
||||
|
||||
@@ -170,7 +170,7 @@ class User < Principal
|
||||
end
|
||||
|
||||
alias :base_reload :reload
|
||||
def reload(*args)
|
||||
def reload(*)
|
||||
@name = nil
|
||||
@roles = nil
|
||||
@projects_by_role = nil
|
||||
@@ -181,7 +181,7 @@ class User < Principal
|
||||
@builtin_role = nil
|
||||
@visible_project_ids = nil
|
||||
@managed_roles = nil
|
||||
base_reload(*args)
|
||||
base_reload(*)
|
||||
end
|
||||
|
||||
def mail
|
||||
|
||||
@@ -211,8 +211,8 @@ class Version < ApplicationRecord
|
||||
end
|
||||
|
||||
# Version files have same visibility as project files
|
||||
def attachments_visible?(*args)
|
||||
project.present? && project.attachments_visible?(*args)
|
||||
def attachments_visible?(*)
|
||||
project.present? && project.attachments_visible?(*)
|
||||
end
|
||||
|
||||
def attachments_deletable?(usr=User.current)
|
||||
@@ -220,10 +220,10 @@ class Version < ApplicationRecord
|
||||
end
|
||||
|
||||
alias :base_reload :reload
|
||||
def reload(*args)
|
||||
def reload(*)
|
||||
@default_project_version = nil
|
||||
@visible_fixed_issues = nil
|
||||
base_reload(*args)
|
||||
base_reload(*)
|
||||
end
|
||||
|
||||
def start_date
|
||||
|
||||
@@ -110,8 +110,8 @@ module Redmine
|
||||
end
|
||||
private_class_method :add
|
||||
|
||||
def self.field_attributes(*args)
|
||||
CustomField.store_accessor :format_store, *args
|
||||
def self.field_attributes(*)
|
||||
CustomField.store_accessor(:format_store, *)
|
||||
end
|
||||
|
||||
field_attributes :url_pattern, :full_width_layout
|
||||
|
||||
@@ -65,9 +65,9 @@ module Redmine
|
||||
end
|
||||
|
||||
# Localizes the given args with user's language
|
||||
def lu(user, *args)
|
||||
def lu(user, *)
|
||||
lang = user.try(:language).presence || Setting.default_language
|
||||
ll(lang, *args)
|
||||
ll(lang, *)
|
||||
end
|
||||
|
||||
def format_date(date)
|
||||
|
||||
@@ -406,8 +406,8 @@ module Redmine
|
||||
# Meeting.find_events('scrums', User.current, 5.days.ago, Date.today, :project => foo) # events for project foo only
|
||||
#
|
||||
# Note that :view_scrums permission is required to view these events in the activity view.
|
||||
def activity_provider(*args)
|
||||
Redmine::Activity.register(*args)
|
||||
def activity_provider(*)
|
||||
Redmine::Activity.register(*)
|
||||
end
|
||||
|
||||
# Registers a wiki formatter.
|
||||
@@ -423,8 +423,8 @@ module Redmine
|
||||
# Examples:
|
||||
# wiki_format_provider(:custom_formatter, CustomFormatter, :label => "My custom formatter")
|
||||
#
|
||||
def wiki_format_provider(name, *args)
|
||||
Redmine::WikiFormatting.register(name, *args)
|
||||
def wiki_format_provider(name, *)
|
||||
Redmine::WikiFormatting.register(name, *)
|
||||
end
|
||||
|
||||
# Register plugin models that use acts_as_attachable.
|
||||
|
||||
@@ -48,8 +48,8 @@ module Redmine
|
||||
normalize!
|
||||
end
|
||||
|
||||
def add(*args)
|
||||
self.class.new(self).add!(*args)
|
||||
def add(*)
|
||||
self.class.new(self).add!(*)
|
||||
end
|
||||
|
||||
def first_key
|
||||
|
||||
@@ -38,10 +38,10 @@ module Redmine
|
||||
end
|
||||
|
||||
# Returns an instance of the given subclass name
|
||||
def new_subclass_instance(class_name, *args)
|
||||
def new_subclass_instance(class_name, *)
|
||||
klass = get_subclass(class_name)
|
||||
if klass
|
||||
klass.new(*args)
|
||||
klass.new(*)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user