From b4f3939ceb8c76dfdd804129b8d909742b8026a2 Mon Sep 17 00:00:00 2001 From: Marc Hassman Date: Thu, 27 Aug 2015 16:49:12 -0500 Subject: [PATCH] unscope for Postgres --- lib/tasks/punching_bag.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/punching_bag.rake b/lib/tasks/punching_bag.rake index 3a614db..307c341 100644 --- a/lib/tasks/punching_bag.rake +++ b/lib/tasks/punching_bag.rake @@ -3,11 +3,11 @@ namespace :punching_bag do task :combine, [:by_hour_after, :by_day_after, :by_month_after, :by_year_after] => [:environment] do |t, args| args.with_defaults :by_hour_after => 24, :by_day_after => 7, :by_month_after => 1, :by_year_after => 1 - punchable_types = Punch.uniq.pluck(:punchable_type) + punchable_types = Punch.unscope(:order).uniq.pluck(:punchable_type) punchable_types.each do |punchable_type| punchables = punchable_type.constantize.find( - Punch.uniq.where(punchable_type: punchable_type).pluck(:punchable_id) + Punch.unscope(:order).uniq.where(punchable_type: punchable_type).pluck(:punchable_id) ) punchables.each do |punchable|