
namespace :password do
  desc "Resets every password in the database to jam123. development only!"
  task smash: :environment do

    raise "This rake taske is only available in development" unless Rails.env == 'development'

    pw = 'jam123'

    User.all.each do |user|
      user.updating_password = true
      user.password = pw
      user.password_confirmation = pw
      user.save
    end
  end
end