mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-18 19:36:48 +00:00
It's best practice to use the ApplicationRecord. But when Rake is loaded, our application is not loaded yet and the ApplicationRecord class wasn't available yet. Requiring within the task solves the problem because Rake loads the Rails environment before executing this task. I also removed the unused highline loading.
12 lines
253 B
Ruby
12 lines
253 B
Ruby
# frozen_string_literal: true
|
|
|
|
namespace :ofn do
|
|
namespace :data do
|
|
desc 'Remove transient data'
|
|
task remove_transient_data: :environment do
|
|
require 'tasks/data/remove_transient_data'
|
|
RemoveTransientData.new.call
|
|
end
|
|
end
|
|
end
|