aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks/temp.rake
blob: ce04c7ddd9e25f9f9904c62198bd33da2b8fbac1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
namespace :temp do

  desc "Remove plaintext passwords from post_redirect params" 
  task :remove_post_redirect_passwords => :environment do 
    PostRedirect.find_each(:conditions => ['post_params_yaml is not null']) do |post_redirect|
      if post_redirect.post_params && post_redirect.post_params[:signchangeemail] && post_redirect.post_params[:signchangeemail][:password]
        params = post_redirect.post_params
        params[:signchangeemail].delete(:password)
        post_redirect.post_params = params
        post_redirect.save!
      end
    end
  end

end