Skip to content

Commit

Permalink
count_by_sql: don't use table alias with any adapters starting with "…
Browse files Browse the repository at this point in the history
…oracle"

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

0 comments on commit 2bd01d0

Please sign in to comment.