diff options
author | Go MAEDA <maeda@farend.jp> | 2021-12-29 06:12:27 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2021-12-29 06:12:27 +0000 |
commit | b6a26a60f3d425f340adc76e27d38c19505f254c (patch) | |
tree | 14475ea267754be1db511bff8ea1cfbf8901faef /app | |
parent | 52aef905ff92ebb34b7b6dbf870405f2351b41b4 (diff) | |
download | redmine-b6a26a60f3d425f340adc76e27d38c19505f254c.tar.gz redmine-b6a26a60f3d425f340adc76e27d38c19505f254c.zip |
Fixes for Performance/StringIdentifierArgument introduced in RuboCop Performance 1.13.0 (#35142).
git-svn-id: http://svn.redmine.org/redmine/trunk@21330 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/gantts_controller.rb | 2 | ||||
-rw-r--r-- | app/models/issue.rb | 12 | ||||
-rw-r--r-- | app/models/journal.rb | 2 | ||||
-rw-r--r-- | app/models/query.rb | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/app/controllers/gantts_controller.rb b/app/controllers/gantts_controller.rb index 303fe3590..548fecc5f 100644 --- a/app/controllers/gantts_controller.rb +++ b/app/controllers/gantts_controller.rb @@ -41,7 +41,7 @@ class GanttsController < ApplicationController respond_to do |format| format.html {render :action => "show", :layout => !request.xhr?} - if @gantt.respond_to?('to_image') + if @gantt.respond_to?(:to_image) format.png do send_data(@gantt.to_image, :disposition => 'inline', :type => 'image/png', diff --git a/app/models/issue.rb b/app/models/issue.rb index 1f12d7948..832cd9b4a 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -1179,7 +1179,7 @@ class Issue < ActiveRecord::Base ).all issues.each do |issue| issue.instance_variable_set( - "@relations", + :@relations, relations.select {|r| r.issue_from_id == issue.id || r.issue_to_id == issue.id} ) end @@ -1191,7 +1191,7 @@ class Issue < ActiveRecord::Base if issues.any? hours_by_issue_id = TimeEntry.visible(user).where(:issue_id => issues.map(&:id)).group(:issue_id).sum(:hours) issues.each do |issue| - issue.instance_variable_set "@spent_hours", (hours_by_issue_id[issue.id] || 0.0) + issue.instance_variable_set :@spent_hours, (hours_by_issue_id[issue.id] || 0.0) end end end @@ -1204,7 +1204,7 @@ class Issue < ActiveRecord::Base " AND parent.lft <= #{Issue.table_name}.lft AND parent.rgt >= #{Issue.table_name}.rgt"). where("parent.id IN (?)", issues.map(&:id)).group("parent.id").sum(:hours) issues.each do |issue| - issue.instance_variable_set "@total_spent_hours", (hours_by_issue_id[issue.id] || 0.0) + issue.instance_variable_set :@total_spent_hours, (hours_by_issue_id[issue.id] || 0.0) end end end @@ -1225,7 +1225,7 @@ class Issue < ActiveRecord::Base relations_from.select {|relation| relation.issue_from_id == issue.id} + relations_to.select {|relation| relation.issue_to_id == issue.id} - issue.instance_variable_set "@relations", IssueRelation::Relations.new(issue, relations.sort) + issue.instance_variable_set :@relations, IssueRelation::Relations.new(issue, relations.sort) end end end @@ -1254,7 +1254,7 @@ class Issue < ActiveRecord::Base issues.each do |issue| journal = journals.detect {|j| j.journalized_id == issue.id} - issue.instance_variable_set("@last_updated_by", journal.try(:user) || '') + issue.instance_variable_set(:@last_updated_by, journal.try(:user) || '') end end end @@ -1274,7 +1274,7 @@ class Issue < ActiveRecord::Base issues.each do |issue| journal = journals.detect {|j| j.journalized_id == issue.id} - issue.instance_variable_set("@last_notes", journal.try(:notes) || '') + issue.instance_variable_set(:@last_notes, journal.try(:notes) || '') end end end diff --git a/app/models/journal.rb b/app/models/journal.rb index f42394bc9..394a249a6 100644 --- a/app/models/journal.rb +++ b/app/models/journal.rb @@ -190,7 +190,7 @@ class Journal < ActiveRecord::Base journals.each do |journal| journal.details.each do |detail| if detail.property == 'cf' - detail.instance_variable_set "@custom_field", fields_by_id[detail.prop_key.to_i] + detail.instance_variable_set :@custom_field, fields_by_id[detail.prop_key.to_i] end end end diff --git a/app/models/query.rb b/app/models/query.rb index 8d5f55061..d21d1409f 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -1095,7 +1095,7 @@ class Query < ActiveRecord::Base end if column.is_a?(QueryCustomFieldColumn) custom_field = column.custom_field - send "total_for_custom_field", custom_field, scope + send :total_for_custom_field, custom_field, scope else send "total_for_#{column.name}", scope end |