FIX: Properly capture period for /filter emotion ordering (#940)
This commit is contained in:
parent
8e00e036e1
commit
2c78961bed
|
@ -17,8 +17,7 @@ module DiscourseAi
|
||||||
end
|
end
|
||||||
&.expr
|
&.expr
|
||||||
&.split(">=")
|
&.split(">=")
|
||||||
&.last if scope.arel.constraints.present? &&
|
&.last if scope.to_sql.include?("topics.bumped_at >=")
|
||||||
scope.arel.constraints.any? { |c| c.is_a?(Arel::Nodes::Grouping) }
|
|
||||||
|
|
||||||
# Fallback in case we can't find the scope period
|
# Fallback in case we can't find the scope period
|
||||||
scope_period ||= "CURRENT_DATE - INTERVAL '1 year'"
|
scope_period ||= "CURRENT_DATE - INTERVAL '1 year'"
|
||||||
|
|
Loading…
Reference in New Issue