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 more Todos

Christophe Bliardec7251874f1b
diff --git a/modules/storages/app/contracts/storages/file_links/delete_contract.rb b/modules/storages/app/contracts/storages/file_links/delete_contract.rb
index b4a9c62133c..d0312486124 100644
--- a/modules/storages/app/contracts/storages/file_links/delete_contract.rb
+++ b/modules/storages/app/contracts/storages/file_links/delete_contract.rb
@@ -31,11 +31,6 @@
module Storages
module FileLinks
class DeleteContract < ::ModelContract
- # ToDo: What is this? Where is this used?
- def self.model
- ::Storages::FileLink
- end
-
# Check permissions to delete(?) this FileLink
validate :validate_manage_allowed
diff --git a/modules/storages/lib/open_project/storages.rb b/modules/storages/lib/open_project/storages.rb
index 7fedc5ea233..edac6370322 100644
--- a/modules/storages/lib/open_project/storages.rb
+++ b/modules/storages/lib/open_project/storages.rb
@@ -26,12 +26,12 @@
# See COPYRIGHT and LICENSE files for more details.
#++
-# ToDo: Why is the require wrapped in two modules and not at the beginning?
-# Does it work like an include?
-# ToDo: I understand this is part of the Engine definition, which has to reside
-# here in the storages/lib folder?
+# This file is required by `modules/storages/lib/openproject-storages.rb` and
+# loads the Rails engine associated with the plugin.
+
+require 'open_project/storages/engine'
+
module OpenProject
module Storages
- require 'open_project/storages/engine'
end
end
diff --git a/modules/storages/lib/open_project/storages/engine.rb b/modules/storages/lib/open_project/storages/engine.rb
index 570cd8cf8b6..d2b638f7151 100644
--- a/modules/storages/lib/open_project/storages/engine.rb
+++ b/modules/storages/lib/open_project/storages/engine.rb
@@ -27,8 +27,9 @@
#++
# See also: Getting started with Engines: https://guides.rubyonrails.org/engines.html
-# This file got generated by the open_project:plugin generator
-# Todo: Which is the part of the system that automatically loads the engines?
+# This file got generated by the open_project:plugin generator.
+# It is loaded by `modules/storages/lib/open_project/storages.rb` when the plugin
+# gets loaded.
module OpenProject::Storages
class Engine < ::Rails::Engine
# engine name is used as a default prefix for module tables when generating
diff --git a/modules/storages/lib/openproject-storages.rb b/modules/storages/lib/openproject-storages.rb
index 0b51a86fa14..cf1697fc436 100644
--- a/modules/storages/lib/openproject-storages.rb
+++ b/modules/storages/lib/openproject-storages.rb
@@ -1,6 +1,6 @@
-# ToDo: Whiy is this file necessary? Where is documentation about the RoR loader? Zeitwerk?
-# This standard guide explains Zeitwerk, but does not explain the "require" below.
-# https://guides.rubyonrails.org/autoloading_and_reloading_constants.html
-# ToDo: Also: Why is this file called openproject-storages.rb? Where is this convention explained?
-# This doesn't seem to follow Zeitwerk conventions.
+# The module follows a structure similar to gems.
+# The name 'openproject-storages' was set with the open_project:plugin generator.
+# The OpenProject plugins, located in modules/, are defined in `Gemfile.modules`.
+# They are loaded from `config/application.rb` when the bundler group :opf_plugins is loaded.
+# This file is responsible for loading the module.
require 'open_project/storages'