All pastes #115426 Raw Edit

Miscellany

public ruby v1 · immutable
·published 2006-08-04 15:46 UTC
rendered paste body
  def self.delete_old_data start_ts,end_ts    start_date = start_ts.strftime("%Y-%m-%d")    end_date = end_ts.strftime("%Y-%m-%d")    Schedule.delete_all "utc_air_date >= '#{start_date}' AND utc_air_date <= '#{end_date}'"    ScheduleAttribute.delete_all "utc_air_date >= '#{start_date}' AND utc_air_date <= '#{end_date}'"    return true  rescue    false  end