Created
January 13, 2014 14:33
-
-
Save LucasPadovan/8401306 to your computer and use it in GitHub Desktop.
Clean payment reports and coupon payments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
payment_reports = PaymentReport.where(medium: 'PagoFacil') | |
payments = Payment.where(payment_report_id: payment_reports.map(&:id)) | |
payments.update_all(payment_report_id: nil) | |
payment_reports.destroy_all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
date = Date.parse('01/12/2013)
CouponPayment.where('created_at > ? AND payment_report_id IS NULL', date)