1 # frozen_string_literal: true
4 desc "Expire MD5 passwords"
5 task :expire_md5_passwords => :environment do
6 chunk_size = ENV["CHUNK_SIZE"]&.to_i || 10_000
9 .where("pass_crypt SIMILAR TO '[0-9a-z]{32}'")
10 .in_batches(:of => chunk_size)
11 .update_all(:pass_crypt => "expired password", :pass_salt => nil)