Skip to content

Commit

Permalink
paginate_by_sql: avoid table alias on Oracle
Browse files Browse the repository at this point in the history
Cherry-pick of 2bd01d0
  • Loading branch information
mislav committed Oct 12, 2010
1 parent 22fe383 commit e273bc7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/will_paginate/finders/active_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e273bc7

Please sign in to comment.