activerecord-sqlserver-adapter 7.2.3 → 7.2.4

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: 05376f4fb4ac7599dc2f61c926eed10a587bb21f34c68dc47de9025d2a031d6d
4
- data.tar.gz: cadbc6f8881d3f8cc70bfa2892abb3a7de2f6805c932c960bc0212c8376fc904
3
+ metadata.gz: e85a529bb9b684087f56962cc806b12aa3138de66dd85ad5985d364a4d749243
4
+ data.tar.gz: 5c5b790e60fc34d9c7ac5eb733f0cbd2b9b5e1dc0a821a5e8af02d1903204a7f
5
5
  SHA512:
6
- metadata.gz: 4ed7c2b41c36c70c0efc188421238224c80093d83430756028d3108402302cb75fe03ca8d07990322fd4c4f58d9e0da51b1180cd310963c34ebd11a15bab65ab
7
- data.tar.gz: 5a4e6f2a659c0fb23e0feadd04d8489f3ac9679767a94f4cf4e4da46de52f0cd70da617cada139ded171efbef2e342833b3967b8bdf2feb4eb48062eb8323d85
6
+ metadata.gz: 1573a27c3712d8ab232b85d33710626988100e98f52f00f6d4d11ef0168c1c27f53ce1ab97b73708507d5ee2b53ee7093b56ab43ae2b75a73fa05554b4e482cf
7
+ data.tar.gz: ca4b98cad31184e0695249cfbf919f02b7c36798a60911d23bf389f3752f11adb055c52f68b8d61ae4116fa574f14b403312f9d39c4f59720c86fa9048802fbe
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v7.2.4
2
+
3
+ #### Fixed
4
+
5
+ - [#1270](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/pull/1270) Fix parsing of raw table name from SQL with extra parentheses
6
+
1
7
  ## v7.2.3
2
8
 
3
9
  #### Fixed
data/VERSION CHANGED
@@ -1 +1 @@
1
- 7.2.3
1
+ 7.2.4
@@ -690,7 +690,7 @@ module ActiveRecord
690
690
  elsif s.match?(/^\s*UPDATE\s+.*/i)
691
691
  s.match(/UPDATE\s+([^\(\s]+)\s*/i)[1]
692
692
  else
693
- s.match(/FROM\s+((\[[^\(\]]+\])|[^\(\s]+)\s*/i)[1]
693
+ s.match(/FROM[\s|\(]+((\[[^\(\]]+\])|[^\(\s]+)\s*/i)[1]
694
694
  end.strip
695
695
  end
696
696
 
@@ -376,6 +376,18 @@ module ActiveRecord
376
376
  end
377
377
 
378
378
  class CalculationsTest < ActiveRecord::TestCase
379
+ # SELECT columns must be in the GROUP clause.
380
+ coerce_tests! :test_should_count_with_group_by_qualified_name_on_loaded
381
+ def test_should_count_with_group_by_qualified_name_on_loaded_coerced
382
+ accounts = Account.group("accounts.id").select("accounts.id")
383
+ expected = { 1 => 1, 2 => 1, 3 => 1, 4 => 1, 5 => 1, 6 => 1 }
384
+ assert_not_predicate accounts, :loaded?
385
+ assert_equal expected, accounts.count
386
+ accounts.load
387
+ assert_predicate accounts, :loaded?
388
+ assert_equal expected, accounts.count(:id)
389
+ end
390
+
379
391
  # Fix randomly failing test. The loading of the model's schema was affecting the test.
380
392
  coerce_tests! :test_offset_is_kept
381
393
  def test_offset_is_kept_coerced
@@ -101,5 +101,11 @@ class SchemaTestSQLServer < ActiveRecord::TestCase
101
101
  assert_equal "[with].[select notation]", connection.send(:get_raw_table_name, "INSERT INTO [with].[select notation] SELECT * FROM [table_name]")
102
102
  end
103
103
  end
104
+
105
+ describe 'CREATE VIEW statements' do
106
+ it do
107
+ assert_equal "test_table_as", connection.send(:get_raw_table_name, "CREATE VIEW test_views ( test_table_a_id, test_table_b_id ) AS SELECT test_table_as.id as test_table_a_id, test_table_bs.id as test_table_b_id FROM (test_table_as with(nolock) LEFT JOIN test_table_bs with(nolock) ON (test_table_as.id = test_table_bs.test_table_a_id))")
108
+ end
109
+ end
104
110
  end
105
111
  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.3
4
+ version: 7.2.4
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-12-08 00:00:00.000000000 Z
18
+ date: 2025-01-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.3/CHANGELOG.md
243
- source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v7.2.3
242
+ changelog_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/blob/v7.2.4/CHANGELOG.md
243
+ source_code_uri: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/tree/v7.2.4
244
244
  post_install_message:
245
245
  rdoc_options: []
246
246
  require_paths: