File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
lib/active_record/connection_adapters/sqlserver/core_ext Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,13 +11,13 @@ module FinderMethods
11
11
12
12
# Same as original except we order by values in distinct select if present.
13
13
def construct_relation_for_exists ( conditions )
14
- if distinct_value && offset_value
15
- relation = limit! ( 1 )
14
+ conditions = sanitize_forbidden_attributes ( conditions )
16
15
16
+ if distinct_value && offset_value
17
17
if select_values . present?
18
- relation = relation . order ( *select_values )
18
+ relation = order ( *select_values ) . limit! ( 1 )
19
19
else
20
- relation = relation . except ( :order )
20
+ relation = except ( :order ) . limit! ( 1 )
21
21
end
22
22
else
23
23
relation = except ( :select , :distinct , :order ) . _select! ( ::ActiveRecord ::FinderMethods ::ONE_AS_ONE ) . limit! ( 1 )
You can’t perform that action at this time.
0 commit comments