activerecord-sqlserver-adapter 7.1.9 → 7.1.10
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: 51943ff8896e187bfaaacc10538c141f72cf0afe8a4b485999259ec91af62af9
|
4
|
+
data.tar.gz: 257d760d9bb1c655447a9b21cab497cbca0c3cf6aa37b840149e239fa19d8051
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad5478179fc31c9cd50ad4bedc8ba9affbff6f0d0eeb21066de9ab5d8b6a60d61f5c3221d3969d6484455be1845e8c1e9643d807f76733e0b45b4d5e75cadf7b
|
7
|
+
data.tar.gz: 4c1ececbe3b65b77a45b9234cb91f9d3b322840d6f10617def9188147b34b8b620cfb4c5a688ac6221f0e6c6b1a30345eade2e9c7e7965f4650ec4f8dfb7ce04
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
7.1.
|
1
|
+
7.1.10
|
@@ -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)
|
@@ -581,4 +581,13 @@ class AdapterTestSQLServer < ActiveRecord::TestCase
|
|
581
581
|
end
|
582
582
|
end
|
583
583
|
end
|
584
|
+
|
585
|
+
describe "distinct select query" do
|
586
|
+
it "generated SQL does not contain unnecessary alias projection" do
|
587
|
+
sqls = capture_sql do
|
588
|
+
Post.includes(:comments).joins(:comments).first
|
589
|
+
end
|
590
|
+
assert_no_match(/AS alias_0/, sqls.first)
|
591
|
+
end
|
592
|
+
end
|
584
593
|
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.1.
|
4
|
+
version: 7.1.10
|
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
|
@@ -240,8 +240,8 @@ licenses:
|
|
240
240
|
- MIT
|
241
241
|
metadata:
|
242
242
|
bug_tracker_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues
|
243
|
-
changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v7.1.
|
244
|
-
source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v7.1.
|
243
|
+
changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v7.1.10/CHANGELOG.md
|
244
|
+
source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v7.1.10
|
245
245
|
post_install_message:
|
246
246
|
rdoc_options: []
|
247
247
|
require_paths:
|