Guest User

Untitled

a guest
Feb 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. require 'rubygems'
  2. require_gem 'activerecord'
  3. require '/var/www/hoosier/app/models/payment_method'
  4.  
  5. #Connect to the database
  6. ActiveRecord::Base.establish_connection(
  7. :adapter => "postgresql",
  8. :host => "localhost",
  9. :username => "****",
  10. :password => "****",
  11. :database => "****"
  12. )
  13.  
  14. #turn on AR logging
  15. ActiveRecord::Base.logger = Logger.new('/var/www/hoosier/log/payment_method_clean_up.log')
  16.  
  17. last_week = Date.today - 8
  18. PaymentMethod.update_all("card_number = ''", ["updated_at < ?", last_week] )
Add Comment
Please, Sign In to add comment