Skip to content

Commit 7cd020d

Browse files
committed
Resolved merge conflicts
1 parent d3c9f75 commit 7cd020d

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -470,12 +470,6 @@ def quote_column_name(name)
470470
end
471471

472472
def add_limit_offset!(sql, options)
473-
<<<<<<< HEAD:lib/active_record/connection_adapters/sqlserver_adapter.rb
474-
if options[:limit] and options[:offset] and options[:offset] > 0
475-
total_rows = @connection.select_all(
476-
"SELECT count(*) as TotalRows from (#{sql.gsub(/\bSELECT(\s+DISTINCT)?\b/i, "SELECT#{$1} TOP 1000000000")}) tally"
477-
)[0][:TotalRows].to_i
478-
=======
479473
if options[:offset]
480474
raise ArgumentError, "offset should have a limit" unless options[:limit]
481475
unless options[:offset].kind_of?Integer
@@ -498,7 +492,6 @@ def add_limit_offset!(sql, options)
498492

499493
if options[:limit] and options[:offset]
500494
total_rows = @connection.select_all("SELECT count(*) as TotalRows from (#{sql.gsub(/\bSELECT(\s+DISTINCT)?\b/i, "SELECT#{$1} TOP 1000000000")}) tally")[0][:TotalRows].to_i
501-
>>>>>>> neoryan/master:lib/active_record/connection_adapters/sqlserver_adapter.rb
502495
if (options[:limit] + options[:offset]) >= total_rows
503496
options[:limit] = (total_rows - options[:offset] >= 0) ? (total_rows - options[:offset]) : 0
504497
end

0 commit comments

Comments
 (0)