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

Redefine rails application methods to use Rails.application

Dombi Attila17296b3c92fb
diff --git a/Rakefile b/Rakefile
index 6dbf99fe781..536d51cd911 100755
--- a/Rakefile
+++ b/Rakefile
@@ -32,7 +32,7 @@
require File.expand_path('config/application', __dir__)
-OpenProject::Application.load_rake_tasks
+Rails.application.load_rake_tasks
Rake::Task[:default].clear
task default: 'test:suite:run'
diff --git a/app/workers/rake_job.rb b/app/workers/rake_job.rb
index b1fde86c9e9..dfeb57477aa 100644
--- a/app/workers/rake_job.rb
+++ b/app/workers/rake_job.rb
@@ -53,7 +53,7 @@ module RakeJob
##
# Load tasks if there are none. This should only be run once in an environment
def load_tasks!
- OpenProject::Application.load_rake_tasks unless tasks_loaded?
+ Rails.application.load_rake_tasks unless tasks_loaded?
end
##
diff --git a/config/application.rb b/config/application.rb
index 0e82e05d923..1d4a8d9ceb7 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -232,13 +232,13 @@ module OpenProject
Settings::Definition.add_all
end
- def self.root_url
+ def root_url
"#{Setting.protocol}://#{Setting.host_name}"
end
##
# Load core and engine tasks we're interested in
- def self.load_rake_tasks
+ def load_rake_tasks
load_tasks
Doorkeeper::Rake.load_tasks
end