activerecord-sqlserver-adapter 8.0.0 → 8.0.1

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: 926f65915d98bb3c271370883fa89891fc575b5c6801cd8c235386c078d34bf5
4
- data.tar.gz: 0a932a9d5edf0d3932e3f0ba44328ed77a033a1223f05699e8f4caa79116ac56
3
+ metadata.gz: c99a1de9708c420caf70ef674f8030ad285cd514110ddac415855918dba0312d
4
+ data.tar.gz: 54a9fd23dc6c22d61f8c7bedbc369ac727b198068e1c33a5937c6440d426c649
5
5
  SHA512:
6
- metadata.gz: ee45540a8d2ae57dc69a35048f4ccfbf01bcfc91e177e57405b19ccb8a3279eef7b752c22dee20c4171c8bb4e2cb0fcaadb99cd6c25d139fd2ef53577a5cb23a
7
- data.tar.gz: 9184a7041e5de445103bcd47832352614897865f0ef49e83067b553786d089be73eb73c34dfaf3f102e02804ee7d8d40803d5582430ebfeecbe95f568b0b7cb7
6
+ metadata.gz: 1c8dc920900865712ca82fa73de5294f5016aa381d5a2c56e2d920d5c2127904576408eaaf3dda6f5a190c4eceb1fb23a3266ed59560703146ca9217e1e0abbf
7
+ data.tar.gz: 266b7a4e3cf8e44fdc9302dac49bc4a53647fe6555769d130ff180b89c50c89e702aa7c6fba7ccc362bf287b6231a63ad5cc16832b19150ec16b1438065fe86c
@@ -1,7 +1,7 @@
1
1
  // For format details, see https://aka.ms/devcontainer.json.
2
2
  {
3
3
  "name": "ActiveRecord SQL Server Adapter project development",
4
- "dockerComposeFile": "docker-compose.yml",
4
+ "dockerComposeFile": "compose.yaml",
5
5
  "service": "activerecord-sqlserver-adapter",
6
6
  "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
7
7
 
@@ -14,14 +14,14 @@ jobs:
14
14
  runs-on: ubuntu-20.04 # TODO: Change back to 'ubuntu-latest' when https://github.com/microsoft/mssql-docker/issues/899 resolved.
15
15
 
16
16
  env:
17
- COMPOSE_FILE: docker-compose.ci.yml
17
+ COMPOSE_FILE: compose.ci.yaml
18
18
 
19
19
  strategy:
20
20
  fail-fast: false
21
21
  matrix:
22
22
  ruby:
23
- - 3.3.4
24
- - 3.2.5
23
+ - 3.3.6
24
+ - 3.2.6
25
25
 
26
26
  steps:
27
27
  - name: Checkout code
data/CHANGELOG.md CHANGED
@@ -1,12 +1,18 @@
1
+ ## v8.0.1
2
+
3
+ #### Fixed
4
+
5
+ - [#1262](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1262) Fix distinct alias when multiple databases used.
6
+
1
7
  ## v8.0.0
2
8
 
3
9
  #### Changed
4
10
 
5
- - [#1216](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1216) Refactor adapter interface to match abstract adapter
6
- - [#1225](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1225) Drop support to Ruby 3.1
11
+ - [#1216](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1216) Refactor adapter interface to match abstract adapter.
12
+ - [#1225](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1225) Drop support to Ruby 3.1.
7
13
 
8
14
  #### Fixed
9
15
 
10
- - [#1215](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1215) Fix mismatched foreign key errors
16
+ - [#1215](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1215) Fix mismatched foreign key errors.
11
17
 
12
18
  Please check [7-2-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/7-2-stable/CHANGELOG.md) for previous changes.
data/README.md CHANGED
@@ -18,7 +18,7 @@ See [Rubygems](https://rubygems.org/gems/activerecord-sqlserver-adapter/versions
18
18
 
19
19
  | Adapter Version | Rails Version | Support | Branch |
20
20
  |-----------------|---------------|----------------|-------------------------------------------------------------------------------------------------|
21
- | `8.0.0` | `8.0.x` | Active | [main](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/main) |
21
+ | `8.0.x` | `8.0.x` | Active | [main](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/main) |
22
22
  | `7.2.x` | `7.2.x` | Active | [7-2-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/7-2-stable) |
23
23
  | `7.1.x` | `7.1.x` | Active | [7-1-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/7-1-stable) |
24
24
  | `7.0.x` | `7.0.x` | Ended | [7-0-stable](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/7-0-stable) |
data/VERSION CHANGED
@@ -1 +1 @@
1
- 8.0.0
1
+ 8.0.1
@@ -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.to_sql unless s.is_a?(String)
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
- }.reject(&:blank?).map.with_index { |column, i| "#{column} AS alias_#{i}" }
353
+ }
354
+ .reject(&:blank?)
355
+ .reject { |s| columns.include?(s) }
354
356
 
355
- (order_columns << super).join(", ")
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)
@@ -616,4 +616,13 @@ class AdapterTestSQLServer < ActiveRecord::TestCase
616
616
  assert_equal Task.where("starting < ?", DateTime.current).count, 1
617
617
  end
618
618
  end
619
+
620
+ describe "distinct select query" do
621
+ it "generated SQL does not contain unnecessary alias projection" do
622
+ sqls = capture_sql do
623
+ Post.includes(:comments).joins(:comments).first
624
+ end
625
+ assert_no_match(/AS alias_0/, sqls.first)
626
+ end
627
+ end
619
628
  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: 8.0.0
4
+ version: 8.0.1
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-11-11 00:00:00.000000000 Z
18
+ date: 2024-12-08 00:00:00.000000000 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: activerecord
@@ -55,8 +55,8 @@ extra_rdoc_files: []
55
55
  files:
56
56
  - ".devcontainer/Dockerfile"
57
57
  - ".devcontainer/boot.sh"
58
+ - ".devcontainer/compose.yaml"
58
59
  - ".devcontainer/devcontainer.json"
59
- - ".devcontainer/docker-compose.yml"
60
60
  - ".editorconfig"
61
61
  - ".github/issue_template.md"
62
62
  - ".github/workflows/ci.yml"
@@ -74,7 +74,7 @@ files:
74
74
  - VERSION
75
75
  - activerecord-sqlserver-adapter.gemspec
76
76
  - appveyor.yml
77
- - docker-compose.ci.yml
77
+ - compose.ci.yaml
78
78
  - guides/RELEASING.md
79
79
  - lib/active_record/connection_adapters/sqlserver/core_ext/abstract_adapter.rb
80
80
  - lib/active_record/connection_adapters/sqlserver/core_ext/active_record.rb
@@ -238,8 +238,8 @@ licenses:
238
238
  - MIT
239
239
  metadata:
240
240
  bug_tracker_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/issues
241
- changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v8.0.0/CHANGELOG.md
242
- source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v8.0.0
241
+ changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v8.0.1/CHANGELOG.md
242
+ source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v8.0.1
243
243
  post_install_message:
244
244
  rdoc_options: []
245
245
  require_paths:
File without changes
File without changes