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

Do not trigger development seeders if installation is obviously old

Christophe Bliardf0a36ad684f6
diff --git a/app/seeders/development_data/projects_seeder.rb b/app/seeders/development_data/projects_seeder.rb
index 8ee201e14fa..51677b913b7 100644
--- a/app/seeders/development_data/projects_seeder.rb
+++ b/app/seeders/development_data/projects_seeder.rb
@@ -47,7 +47,13 @@ module DevelopmentData
end
def applicable?
- Project.where(identifier: project_identifiers).count == 0
+ recent_installation? && Project.where(identifier: project_identifiers).count == 0
+ end
+
+ # returns true if no projects have been created more than 1 hour ago,
+ # meaning this is a recent installation
+ def recent_installation?
+ Project.where(created_at: ..1.hour.ago).none?
end
def project_identifiers