Skip to content

Commit 2c78961

Browse files
authored
FIX: Properly capture period for /filter emotion ordering (#940)
1 parent 8e00e03 commit 2c78961

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/sentiment/emotion_filter_order.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ def self.register!(plugin)
1717
end
1818
&.expr
1919
&.split(">=")
20-
&.last if scope.arel.constraints.present? &&
21-
scope.arel.constraints.any? { |c| c.is_a?(Arel::Nodes::Grouping) }
20+
&.last if scope.to_sql.include?("topics.bumped_at >=")
2221

2322
# Fallback in case we can't find the scope period
2423
scope_period ||= "CURRENT_DATE - INTERVAL '1 year'"

0 commit comments

Comments
 (0)