Actions
Defect #43195
open5.1-stable fails with RuboCop error Layout/EmptyLineAfterGuardClause
Start date:
Due date:
% Done:
0%
Estimated time:
Resolution:
Fixed
Affected version:
Description
The CI fails in the 5.1-stable branch due to a RuboCop warning:
https://github.com/redmine/redmine/actions/runs/17564475662/job/49888343834
app/models/issue.rb:2083:5: C: [Correctable] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause. return unless custom_field_values_changed? ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Updated by Katsuya HIDAKA 4 days ago
Here is a patch to fix the warning:
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 3f841cffc..66e8e2ccb 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -2081,6 +2081,7 @@ class Issue < ActiveRecord::Base
# current user.
def force_default_value_on_noneditable_custom_fields
return unless custom_field_values_changed?
+
editable_custom_field_ids = editable_custom_fields(author).map(&:id)
custom_field_values.each do |field_value|
unless editable_custom_field_ids.include?(field_value.custom_field_id)
Updated by Marius BĂLTEANU 3 days ago
- Status changed from New to Resolved
- Assignee set to Marius BĂLTEANU
- Resolution set to Fixed
Fixed, thanks
Actions