Skip to content

Commit

Permalink
eager loading Rails before rake task (#9)
Browse files Browse the repository at this point in the history
* eager loading Rails before rake task

* Code cleanup
  • Loading branch information
keshavbiswa authored Mar 16, 2024
1 parent 51ad978 commit f0b32de
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/tasks/active_record_anonymizer.rake
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ namespace :anonymizer do
namespace :populate do
desc "populate anonymize columns for all models"
task all: :environment do
Rails.application.eager_load!

ActiveRecordAnonymizer.models.each do |model|
puts "Anonymizing #{model.name}..."
model.find_each do |record|
Expand Down

0 comments on commit f0b32de

Please sign in to comment.