1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-21 16:01:14 +00:00

add empty line after guard clause to app/models/issue.rb

git-svn-id: http://svn.redmine.org/redmine/trunk@19887 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2020-07-11 16:21:37 +00:00
parent 26bf703530
commit 2f478664f7

View File

@ -436,6 +436,7 @@ class Issue < ActiveRecord::Base
# Overrides assign_attributes so that project and tracker get assigned first # Overrides assign_attributes so that project and tracker get assigned first
def assign_attributes(new_attributes, *args) def assign_attributes(new_attributes, *args)
return if new_attributes.nil? return if new_attributes.nil?
attrs = new_attributes.dup attrs = new_attributes.dup
attrs.stringify_keys! attrs.stringify_keys!
@ -685,6 +686,7 @@ class Issue < ActiveRecord::Base
end end
workflow_rules.each do |attr, rules| workflow_rules.each do |attr, rules|
next if rules.size < roles.size next if rules.size < roles.size
uniq_rules = rules.values.uniq uniq_rules = rules.values.uniq
if uniq_rules.size == 1 if uniq_rules.size == 1
result[attr] = uniq_rules.first result[attr] = uniq_rules.first
@ -784,6 +786,7 @@ class Issue < ActiveRecord::Base
if respond_to?(attribute) && send(attribute).blank? && !disabled_core_fields.include?(attribute) if respond_to?(attribute) && send(attribute).blank? && !disabled_core_fields.include?(attribute)
next if attribute == 'category_id' && project.try(:issue_categories).blank? next if attribute == 'category_id' && project.try(:issue_categories).blank?
next if attribute == 'fixed_version_id' && assignable_versions.blank? next if attribute == 'fixed_version_id' && assignable_versions.blank?
errors.add attribute, :blank errors.add attribute, :blank
end end
end end
@ -927,6 +930,7 @@ class Issue < ActiveRecord::Base
# Is the amount of work done less than it should for the due date # Is the amount of work done less than it should for the due date
def behind_schedule? def behind_schedule?
return false if start_date.nil? || due_date.nil? return false if start_date.nil? || due_date.nil?
done_date = start_date + ((due_date - start_date + 1) * done_ratio / 100).floor done_date = start_date + ((due_date - start_date + 1) * done_ratio / 100).floor
return done_date <= User.current.today return done_date <= User.current.today
end end
@ -1248,6 +1252,7 @@ class Issue < ActiveRecord::Base
current -= last current -= last
current -= all current -= all
return true if current.include?(other) return true if current.include?(other)
last = current last = current
all += last all += last
end end
@ -1267,6 +1272,7 @@ class Issue < ActiveRecord::Base
current -= last current -= last
current -= all current -= all
return true if current.include?(other) return true if current.include?(other)
last = current last = current
all += last all += last
end end
@ -1324,6 +1330,7 @@ class Issue < ActiveRecord::Base
# If the issue is a parent task, this is done by rescheduling its subtasks. # If the issue is a parent task, this is done by rescheduling its subtasks.
def reschedule_on!(date, journal=nil) def reschedule_on!(date, journal=nil)
return if date.nil? return if date.nil?
if leaf? || !dates_derived? if leaf? || !dates_derived?
if start_date.nil? || start_date != date if start_date.nil? || start_date != date
if start_date && start_date > date if start_date && start_date > date
@ -1468,6 +1475,7 @@ class Issue < ActiveRecord::Base
if project.nil? if project.nil?
return Issue return Issue
end end
case scope case scope
when 'all', 'system' when 'all', 'system'
Issue Issue
@ -1621,6 +1629,7 @@ class Issue < ActiveRecord::Base
# Move subtasks that were in the same project # Move subtasks that were in the same project
children.each do |child| children.each do |child|
next unless child.project_id == project_id_before_last_save next unless child.project_id == project_id_before_last_save
# Change project and keep project # Change project and keep project
child.send :project=, project, true child.send :project=, project, true
unless child.save unless child.save
@ -1654,6 +1663,7 @@ class Issue < ActiveRecord::Base
next if child == self next if child == self
# Do not copy subtasks of issues that were not copied # Do not copy subtasks of issues that were not copied
next unless copied_issue_ids[child.parent_id] next unless copied_issue_ids[child.parent_id]
# Do not copy subtasks that are not visible to avoid potential disclosure of private data # Do not copy subtasks that are not visible to avoid potential disclosure of private data
unless child.visible? unless child.visible?
logger.error "Subtask ##{child.id} was not copied during ##{@copied_from.id} copy because it is not visible to the current user" if logger logger.error "Subtask ##{child.id} was not copied during ##{@copied_from.id} copy because it is not visible to the current user" if logger
@ -1767,6 +1777,7 @@ class Issue < ActiveRecord::Base
" AND #{Version.table_name}.sharing <> 'system'"). " AND #{Version.table_name}.sharing <> 'system'").
where(conditions).each do |issue| where(conditions).each do |issue|
next if issue.project.nil? || issue.fixed_version.nil? next if issue.project.nil? || issue.fixed_version.nil?
unless issue.project.shared_versions.include?(issue.fixed_version) unless issue.project.shared_versions.include?(issue.fixed_version)
issue.init_journal(User.current) issue.init_journal(User.current)
issue.fixed_version = nil issue.fixed_version = nil
@ -1842,6 +1853,7 @@ class Issue < ActiveRecord::Base
duplicate.reload duplicate.reload
# Don't re-close it if it's already closed # Don't re-close it if it's already closed
next if duplicate.closed? next if duplicate.closed?
# Same user and notes # Same user and notes
if @current_journal if @current_journal
duplicate.init_journal(@current_journal.user, @current_journal.notes) duplicate.init_journal(@current_journal.user, @current_journal.notes)