Skip to content

Commit e9a8840

Browse files
committed
Merged in everyone elses stuff and the tweaked / commented the single major issue that arose (construct_finder_sql)
1 parent a8e94b5 commit e9a8840

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/active_record/connection_adapters/sqlserver_adapter.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,17 @@ def self.sqlserver_connection(config) #:nodoc:
6262
# In the case of SQL server, the lock value must follow the FROM clause
6363
# Mysql: SELECT * FROM tst where testID = 10 LOCK IN share mode
6464
# SQLServer: SELECT * from tst WITH (HOLDLOCK, ROWLOCK) where testID = 10
65+
# h-lame: OK, so these 2 methods should be a patch to rails ideally, so we don't
66+
# have to play catch up against rails itself should construct_finder_sql ever
67+
# change
6568
def self.construct_finder_sql(options)
6669
scope = scope(:find)
6770
sql = "SELECT #{options[:select] || (scope && scope[:select]) || ((options[:joins] || (scope && scope[:joins])) && quoted_table_name + '.*') || '*'} "
6871
sql << "FROM #{(scope && scope[:from]) || options[:from] || quoted_table_name} "
6972

7073
add_lock!(sql, options, scope) if ActiveRecord::Base.connection.adapter_name == "SQLServer" && !options[:lock].blank? # SQLServer
7174

72-
add_joins!(sql, options, scope)
75+
add_joins!(sql, options[:joins], scope)
7376
add_conditions!(sql, options[:conditions], scope)
7477

7578
add_group!(sql, options[:group], scope)

0 commit comments

Comments
 (0)