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

avoid repetition of a method

ulfertsee6ba98c261f
diff --git a/lib/api/v3/work_packages/timestamped_representer.rb b/lib/api/v3/work_packages/timestamped_representer.rb
index 40898da4d97..e77edb6ddb0 100644
--- a/lib/api/v3/work_packages/timestamped_representer.rb
+++ b/lib/api/v3/work_packages/timestamped_representer.rb
@@ -68,6 +68,10 @@ module API::V3::WorkPackages
embedded: true,
uncacheable: true,
exec_context: :decorator
+
+ def timestamps_active?
+ timestamps.any?(&:historic?)
+ end
end
end
end
diff --git a/lib/api/v3/work_packages/work_package_deleted_representer.rb b/lib/api/v3/work_packages/work_package_deleted_representer.rb
index 3c605b8c799..3c4dd3a1487 100644
--- a/lib/api/v3/work_packages/work_package_deleted_representer.rb
+++ b/lib/api/v3/work_packages/work_package_deleted_representer.rb
@@ -52,10 +52,6 @@ module API
def _type
'WorkPackage'
end
-
- def timestamps_active?
- timestamps.any?(&:historic?)
- end
end
end
end
diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rb
index e73e2197131..5147c0e1d05 100644
--- a/lib/api/v3/work_packages/work_package_representer.rb
+++ b/lib/api/v3/work_packages/work_package_representer.rb
@@ -635,10 +635,6 @@ module API
@ordered_custom_actions ||= represented.custom_actions(current_user).to_a.sort_by(&:position)
end
- def timestamps_active?
- timestamps.any?(&:historic?)
- end
-
# Attachments need to be eager loaded for the description
self.to_eager_load = %i[parent
type