namespace :debug do
desc 'Resets all user passwords to a specified value'
task reset_passwords: :environment do
unless Rails.env.development?
puts 'This task can only be run in development'
exit 0
end
pass = User.new(password: 'new_password').encrypted_password
User.update_all(encrypted_password: pass)
end
end
Comments