Skip to content
Browse files

count_by_sql: don't use table alias with any adapters starting with "…

…oracle"

Partially resolves the #237 problem. With JDBC, it still remains an issue
because the adapter shows up as "jdbc", not "oracle" or "oci"
  • Loading branch information...
1 parent f5be4f6 commit 2bd01d0a347940fd4dfe0b3818aabea11b87680f @mislav mislav committed May 21, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/will_paginate/finder.rb
View
2 lib/will_paginate/finder.rb
@@ -141,7 +141,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 2bd01d0

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