From 030a03613981aef6aebcd626f2da26354707ca22 Mon Sep 17 00:00:00 2001 From: Artur Beljajev Date: Fri, 22 Mar 2019 15:44:31 +0200 Subject: [PATCH] Do not load the whole environment for rake tasks --- Rakefile | 2 +- lib/tasks/bootstrap.rake | 2 +- lib/tasks/domains/release.rake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 223f8b92f..ba6b733dd 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,6 @@ # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. -require File.expand_path('../config/environment', __FILE__) +require File.expand_path('../config/application', __FILE__) Rails.application.load_tasks diff --git a/lib/tasks/bootstrap.rake b/lib/tasks/bootstrap.rake index 1b3af2fe7..bf19f4bdc 100644 --- a/lib/tasks/bootstrap.rake +++ b/lib/tasks/bootstrap.rake @@ -1,5 +1,5 @@ desc 'Bootstraps production-like environment' -task :bootstrap do +task bootstrap: :environment do AdminUser.create!( username: 'admin', email: 'admin@domain.tld', diff --git a/lib/tasks/domains/release.rake b/lib/tasks/domains/release.rake index 70aed201e..0b9f0c19d 100644 --- a/lib/tasks/domains/release.rake +++ b/lib/tasks/domains/release.rake @@ -4,7 +4,7 @@ namespace :domains do depending on `release_domains_to_auction` setting TEXT - task :release do + task release: :environment do released_domain_count = 0 Domain.release_domains do |domain|