Skip to content
Browse files

paginate_by_sql: avoid table alias on Oracle

Cherry-pick of 2bd01d0
  • Loading branch information...
1 parent 22fe383 commit e273bc7f7bd48a5d5ac581918007e0c5c6865336 @mislav committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/will_paginate/finders/active_record.rb
View
2 lib/will_paginate/finders/active_record.rb
@@ -65,7 +65,7 @@ def paginate_by_sql(sql, options)
count_query = original_query.sub /\bORDER\s+BY\s+[\w`,\s]+$/mi, ''
count_query = "SELECT COUNT(*) FROM (#{count_query})"
- unless ['oracle', 'oci'].include?(self.connection.adapter_name.downcase)
+ unless self.connection.adapter_name =~ /^(oracle|oci$)/i
count_query << ' AS count_table'
end
# perform the count query

0 comments on commit e273bc7

Please sign in to comment.
Something went wrong with that request. Please try again.