Do not load the whole environment for rake tasks

This commit is contained in:
Artur Beljajev 2019-03-22 15:44:31 +02:00
parent ce1a5fd5f1
commit 030a036139
3 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -1,5 +1,5 @@
desc 'Bootstraps production-like environment'
task :bootstrap do
task bootstrap: :environment do
AdminUser.create!(
username: 'admin',
email: 'admin@domain.tld',

View file

@ -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|