diff options
Diffstat (limited to 'activerecord/lib/arel/visitors/oracle.rb')
-rw-r--r-- | activerecord/lib/arel/visitors/oracle.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/arel/visitors/oracle.rb b/activerecord/lib/arel/visitors/oracle.rb index aab66301ef..a0a74d365c 100644 --- a/activerecord/lib/arel/visitors/oracle.rb +++ b/activerecord/lib/arel/visitors/oracle.rb @@ -9,7 +9,7 @@ module Arel # :nodoc: all # if need to select first records without ORDER BY and GROUP BY and without DISTINCT # then can use simple ROWNUM in WHERE clause - if o.limit && o.orders.empty? && o.cores.first.groups.empty? && !o.offset && o.cores.first.set_quantifier.class.to_s !~ /Distinct/ + if o.limit && o.orders.empty? && o.cores.first.groups.empty? && !o.offset && !o.cores.first.set_quantifier.class.to_s.match?(/Distinct/) o.cores.last.wheres.push Nodes::LessThanOrEqual.new( Nodes::SqlLiteral.new("ROWNUM"), o.limit.expr ) @@ -122,7 +122,7 @@ module Arel # :nodoc: all o.orders = [] orders.each_with_index do |order, i| o.orders << - Nodes::SqlLiteral.new("alias_#{i}__#{' DESC' if /\bdesc$/i === order}") + Nodes::SqlLiteral.new("alias_#{i}__#{' DESC' if /\bdesc$/i.match?(order)}") end o end |