diff options
author | Go MAEDA <maeda@farend.jp> | 2024-08-21 00:46:15 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2024-08-21 00:46:15 +0000 |
commit | 93645a279e68b5f23d13c340d96ede3f65aff635 (patch) | |
tree | 99c47c51197d9b285fe4b05d073fd55208df54e5 /app/helpers | |
parent | c069ea3a2440f4cb0641abd4e3ddb6be5bd6bdb2 (diff) | |
download | redmine-93645a279e68b5f23d13c340d96ede3f65aff635.tar.gz redmine-93645a279e68b5f23d13c340d96ede3f65aff635.zip |
Use anonymous block forwarding introduced in Ruby 3.1 (#38585).
git-svn-id: https://svn.redmine.org/redmine/trunk@22973 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 24 | ||||
-rw-r--r-- | app/helpers/custom_fields_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/issues_helper.rb | 4 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/queries_helper.rb | 2 |
5 files changed, 17 insertions, 17 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 58189c3e5..369291a3c 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -638,8 +638,8 @@ module ApplicationHelper # Yields the given block for each project with its level in the tree # # Wrapper for Project#project_tree - def project_tree(projects, options={}, &block) - Project.project_tree(projects, options, &block) + def project_tree(projects, options={}, &) + Project.project_tree(projects, options, &) end def principals_check_box_tags(name, principals) @@ -755,7 +755,7 @@ module ApplicationHelper elements.any? ? content_tag('p', (args.join(" \xc2\xbb ") + " \xc2\xbb ").html_safe, :class => 'breadcrumb') : nil end - def other_formats_links(&block) + def other_formats_links(&) concat('<p class="other-formats">'.html_safe + l(:label_export_to)) yield Redmine::Views::OtherFormatsBuilder.new(self) concat('</p>'.html_safe) @@ -820,8 +820,8 @@ module ApplicationHelper end end - def actions_dropdown(&block) - content = capture(&block) + def actions_dropdown(&) + content = capture(&) if content.present? trigger = content_tag('span', l(:button_actions), :class => 'icon-only icon-actions', @@ -1508,21 +1508,21 @@ module ApplicationHelper (blank ? [["(#{l('label_option_auto_lang')})", ""]] : []) + languages_options end - def labelled_form_for(*args, &proc) + def labelled_form_for(*args, &) args << {} unless args.last.is_a?(Hash) options = args.last if args.first.is_a?(Symbol) options[:as] = args.shift end options[:builder] = Redmine::Views::LabelledFormBuilder - form_for(*args, &proc) + form_for(*args, &) end - def labelled_fields_for(*args, &proc) + def labelled_fields_for(*args, &) args << {} unless args.last.is_a?(Hash) options = args.last options[:builder] = Redmine::Views::LabelledFormBuilder - fields_for(*args, &proc) + fields_for(*args, &) end def form_tag_html(html_options) @@ -1866,17 +1866,17 @@ module ApplicationHelper end end - def render_if_exist(options = {}, locals = {}, &block) + def render_if_exist(options = {}, locals = {}, &) # Remove test_render_if_exist_should_be_render_partial and test_render_if_exist_should_be_render_nil # along with this method in Redmine 7.0 Rails.application.deprecators[:redmine].warn 'ApplicationHelper#render_if_exist is deprecated and will be removed in Redmine 7.0.' if options[:partial] if lookup_context.exists?(options[:partial], lookup_context.prefixes, true) - render(options, locals, &block) + render(options, locals, &) end else - render(options, locals, &block) + render(options, locals, &) end end diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb index f59a8f4cd..82b78cdcb 100644 --- a/app/helpers/custom_fields_helper.rb +++ b/app/helpers/custom_fields_helper.rb @@ -178,7 +178,7 @@ module CustomFieldsHelper # Yields the given block for each custom field value of object that should be # displayed, with the custom field and the formatted value as arguments - def render_custom_field_values(object, &block) + def render_custom_field_values(object, &) object.visible_custom_field_values.each do |custom_value| formatted = show_value(custom_value) if formatted.present? diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 5661cf377..1455fa1c5 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -22,7 +22,7 @@ module IssuesHelper include Redmine::Export::PDF::IssuesPdfHelper include IssueStatusesHelper - def issue_list(issues, &block) + def issue_list(issues, &) ancestors = [] issues.each do |issue| while ancestors.any? && @@ -34,7 +34,7 @@ module IssuesHelper end end - def grouped_issue_list(issues, query, &block) + def grouped_issue_list(issues, query, &) ancestors = [] grouped_query_results(issues, query) do |issue, group_name, group_count, group_totals| while ancestors.any? && diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 43c89a350..5a8649dc3 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -194,7 +194,7 @@ module ProjectsHelper link_to text, url, remote: true, method: method, class: css end - def grouped_project_list(projects, query, &block) + def grouped_project_list(projects, query, &) ancestors = [] grouped_query_results(projects, query) do |project, group_name, group_count, group_totals| ancestors.pop while ancestors.any? && !project.is_descendant_of?(ancestors.last) diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index b5ce6addd..516088f8d 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -151,7 +151,7 @@ module QueriesHelper tags end - def grouped_query_results(items, query, &block) + def grouped_query_results(items, query, &) result_count_by_group = query.result_count_by_group previous_group, first = false, true totals_by_group = query.totalable_columns.inject({}) do |h, column| |