From 15b09e0d38376fc6f74bf75886af4d2f8cc4f425 Mon Sep 17 00:00:00 2001 From: Oleg Orlov Date: Fri, 14 Jan 2022 15:40:56 +0300 Subject: [PATCH] Use reorder instead of order in #latest method --- lib/acts_as_span/span_klass/superlatives.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/acts_as_span/span_klass/superlatives.rb b/lib/acts_as_span/span_klass/superlatives.rb index a5eef0b..0d7a5fe 100644 --- a/lib/acts_as_span/span_klass/superlatives.rb +++ b/lib/acts_as_span/span_klass/superlatives.rb @@ -62,7 +62,7 @@ def earliest(by: :start) def latest(by: :start) field = field_from_option(by) - klass.order(field => :desc).first + klass.reorder(field => :desc).first end private