Skip to content

Instantly share code, notes, and snippets.

@entryway
Created September 7, 2008 20:48
Show Gist options
  • Save entryway/9313 to your computer and use it in GitHub Desktop.
Save entryway/9313 to your computer and use it in GitHub Desktop.
require 'rubygems'
require_gem 'activerecord'
require '/var/www/hoosier/app/models/payment_method'
#Connect to the database
ActiveRecord::Base.establish_connection(
:adapter => "postgresql",
:host => "localhost",
:username => "****",
:password => "****",
:database => "****"
)
#turn on AR logging
ActiveRecord::Base.logger = Logger.new('/var/www/hoosier/log/payment_method_clean_up.log')
last_week = Date.today - 8
PaymentMethod.update_all("card_number = ''", ["updated_at < ?", last_week] )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment