Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

fix missing refactoring

as-op51b9baa57beb
diff --git a/app/models/type/pdf_export_templates.rb b/app/models/type/pdf_export_templates.rb
index b0a5cd90ee8..219f3315b80 100644
--- a/app/models/type/pdf_export_templates.rb
+++ b/app/models/type/pdf_export_templates.rb
@@ -31,8 +31,8 @@
class Type::PdfExportTemplates
Template = Data.define(:id, :label, :caption, :enabled)
- def initialize(model)
- @type = model
+ def initialize(type)
+ @type = type
end
def list
@@ -78,11 +78,11 @@ class Type::PdfExportTemplates
end
def move(template_id, position)
- template_ids = @type.pdf_export_templates_for_type.map(&:id)
- prev_index = template_ids.find_index(template_id)
- template_ids.delete_at(prev_index) unless prev_index.nil?
- template_ids.insert(position, template_id)
- @type.export_templates_order = template_ids
+ ordered_template_ids = list.map(&:id)
+ prev_index = ordered_template_ids.find_index(template_id)
+ ordered_template_ids.delete_at(prev_index) unless prev_index.nil?
+ ordered_template_ids.insert(position, template_id)
+ @type.export_templates_order = ordered_template_ids
end
private