activerecord-sqlserver-adapter 7.2.2 → 7.2.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05376f4fb4ac7599dc2f61c926eed10a587bb21f34c68dc47de9025d2a031d6d
|
4
|
+
data.tar.gz: cadbc6f8881d3f8cc70bfa2892abb3a7de2f6805c932c960bc0212c8376fc904
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ed7c2b41c36c70c0efc188421238224c80093d83430756028d3108402302cb75fe03ca8d07990322fd4c4f58d9e0da51b1180cd310963c34ebd11a15bab65ab
|
7
|
+
data.tar.gz: 5a4e6f2a659c0fb23e0feadd04d8489f3ac9679767a94f4cf4e4da46de52f0cd70da617cada139ded171efbef2e342833b3967b8bdf2feb4eb48062eb8323d85
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.2.
|
1
|
+
7.2.3
|
@@ -347,12 +347,16 @@ module ActiveRecord
|
|
347
347
|
|
348
348
|
def columns_for_distinct(columns, orders)
|
349
349
|
order_columns = orders.reject(&:blank?).map { |s|
|
350
|
-
s = s
|
350
|
+
s = visitor.compile(s) unless s.is_a?(String)
|
351
351
|
s.gsub(/\s+(?:ASC|DESC)\b/i, "")
|
352
352
|
.gsub(/\s+NULLS\s+(?:FIRST|LAST)\b/i, "")
|
353
|
-
|
353
|
+
}
|
354
|
+
.reject(&:blank?)
|
355
|
+
.reject { |s| columns.include?(s) }
|
354
356
|
|
355
|
-
|
357
|
+
order_columns_aliased = order_columns.map.with_index { |column, i| "#{column} AS alias_#{i}" }
|
358
|
+
|
359
|
+
(order_columns_aliased << super).join(", ")
|
356
360
|
end
|
357
361
|
|
358
362
|
def update_table_definition(table_name, base)
|
@@ -594,4 +594,13 @@ class AdapterTestSQLServer < ActiveRecord::TestCase
|
|
594
594
|
assert_equal Task.where("starting < ?", DateTime.current).count, 1
|
595
595
|
end
|
596
596
|
end
|
597
|
+
|
598
|
+
describe "distinct select query" do
|
599
|
+
it "generated SQL does not contain unnecessary alias projection" do
|
600
|
+
sqls = capture_sql do
|
601
|
+
Post.includes(:comments).joins(:comments).first
|
602
|
+
end
|
603
|
+
assert_no_match(/AS alias_0/, sqls.first)
|
604
|
+
end
|
605
|
+
end
|
597
606
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-sqlserver-adapter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.2.
|
4
|
+
version: 7.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken Collins
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2024-
|
18
|
+
date: 2024-12-08 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activerecord
|
@@ -239,8 +239,8 @@ licenses:
|
|
239
239
|
- MIT
|
240
240
|
metadata:
|
241
241
|
bug_tracker_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues
|
242
|
-
changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v7.2.
|
243
|
-
source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v7.2.
|
242
|
+
changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v7.2.3/CHANGELOG.md
|
243
|
+
source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v7.2.3
|
244
244
|
post_install_message:
|
245
245
|
rdoc_options: []
|
246
246
|
require_paths:
|