File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
lib/active_record/connection_adapters Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments