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
1111
1212 # Same as original except we order by values in distinct select if present.
1313 def construct_relation_for_exists ( conditions )
14- if distinct_value && offset_value
15- relation = limit! ( 1 )
14+ conditions = sanitize_forbidden_attributes ( conditions )
1615
16+ if distinct_value && offset_value
1717 if select_values . present?
18- relation = relation . order ( *select_values )
18+ relation = order ( *select_values ) . limit! ( 1 )
1919 else
20- relation = relation . except ( :order )
20+ relation = except ( :order ) . limit! ( 1 )
2121 end
2222 else
2323 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