Skip to content

Instantly share code, notes, and snippets.

@mndoci
Forked from entryway/gist:9313
Created September 7, 2008 20:49
Show Gist options
  • Save mndoci/9314 to your computer and use it in GitHub Desktop.
Save mndoci/9314 to your computer and use it in GitHub Desktop.
undefined
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