summaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-19 13:33:43 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2019-10-19 13:33:43 +0000
commit75d3e4037bf22d940d8908b69a2a56c86249afe4 (patch)
treeadba9b187e14f5b30dbb933ee20b6a5f6a6cf37e /app/models
parentfd7675adf2623f733da525e9912f5ce52ff31c71 (diff)
downloadredmine-75d3e4037bf22d940d8908b69a2a56c86249afe4.tar.gz
redmine-75d3e4037bf22d940d8908b69a2a56c86249afe4.zip
code cleanup: rubocop: fix Lint/IneffectiveAccessModifier in app/models/issue.rb
git-svn-id: http://svn.redmine.org/redmine/trunk@18780 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/models')
-rw-r--r--app/models/issue.rb33
1 files changed, 18 insertions, 15 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index f25c0f295..e17f2c941 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -1724,21 +1724,24 @@ class Issue < ActiveRecord::Base
end
end
- # Update issues so their versions are not pointing to a
- # fixed_version that is not shared with the issue's project
- def self.update_versions(conditions=nil)
- # Only need to update issues with a fixed_version from
- # a different project and that is not systemwide shared
- Issue.joins(:project, :fixed_version).
- where("#{Issue.table_name}.fixed_version_id IS NOT NULL" +
- " AND #{Issue.table_name}.project_id <> #{Version.table_name}.project_id" +
- " AND #{Version.table_name}.sharing <> 'system'").
- where(conditions).each do |issue|
- next if issue.project.nil? || issue.fixed_version.nil?
- unless issue.project.shared_versions.include?(issue.fixed_version)
- issue.init_journal(User.current)
- issue.fixed_version = nil
- issue.save
+ # Singleton class method is public
+ class << self
+ # Update issues so their versions are not pointing to a
+ # fixed_version that is not shared with the issue's project
+ def update_versions(conditions=nil)
+ # Only need to update issues with a fixed_version from
+ # a different project and that is not systemwide shared
+ Issue.joins(:project, :fixed_version).
+ where("#{Issue.table_name}.fixed_version_id IS NOT NULL" +
+ " AND #{Issue.table_name}.project_id <> #{Version.table_name}.project_id" +
+ " AND #{Version.table_name}.sharing <> 'system'").
+ where(conditions).each do |issue|
+ next if issue.project.nil? || issue.fixed_version.nil?
+ unless issue.project.shared_versions.include?(issue.fixed_version)
+ issue.init_journal(User.current)
+ issue.fixed_version = nil
+ issue.save
+ end
end
end
end