Skip to content
Browse files

mssql: use subscript instead of #first. Thanks Kim Toms.

Fixes #74
  • Loading branch information...
1 parent 4a29d56 commit 4b20abe4173ff36df1db921df7bf6a377f99e432 @nicksieger nicksieger committed Jun 28, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/arjdbc/mssql/limit_helpers.rb
View
4 lib/arjdbc/mssql/limit_helpers.rb
@@ -69,10 +69,10 @@ def replace_limit_offset!(sql, limit, offset, order)
find_select = /\b(SELECT(?:\s+DISTINCT)?)\b(.*)/im
whole, select, rest_of_query = find_select.match(sql).to_a
rest_of_query.strip!
- if rest_of_query.first == "1"
+ if rest_of_query[0] == "1"
rest_of_query[0] = "*"
end
- if rest_of_query.first == "*"
+ if rest_of_query[0] == "*"
from_table = LimitHelpers.get_table_name(rest_of_query)
rest_of_query = from_table + '.' + rest_of_query
end

0 comments on commit 4b20abe

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