composite_primary_keys 13.0.6 → 13.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0759acf9a94a27e2baafbc5cf15b334f5364b4424120adfcd59a4ed9f783267
4
- data.tar.gz: cae92844f0543e33b85b91620d06ab9032cda41c6e9e7ef27bfeec81d1e2027e
3
+ metadata.gz: e705c71e8e7a1f2d4aee39d46ba133177960963c2d126ee41caea675ad743dfe
4
+ data.tar.gz: 266bba1595212c20101e3052cc2a24de8654ce817412b82cfbacee6cf3044c56
5
5
  SHA512:
6
- metadata.gz: 85d3dfab843abaf4371da5717d5b0962b281e81e9e3294fd2154571bec87d3e46b6852cc36be0de1c8aebec0f892a74c04e49296409d94d842bd18a0e7380534
7
- data.tar.gz: 5d31a6dca9bd32215fcdf42c095eee41d6f6f56aef08c2ebda5dfef5d33686636f631542a029636da0dd7c6565bd48f8f99f606d137db532db9544aaee72b790
6
+ metadata.gz: 80a8ad394e2393f3fbae332a9ba5d8db8bea4484b09834e5ef0749395b188e796e13cab5625688530e4f299464400e2cf0dc67a37f6a27160890cbe08ae8857d
7
+ data.tar.gz: 48a459a2296938f41a40e98e8f533ae0d7ee8bcd427406dd05af4a1a697466c19e1ba4d4c2212b7d4518e1308ef528ec83f1d52b5b59808016c65d8314c3f074
data/History.rdoc CHANGED
@@ -1,3 +1,6 @@
1
+ == 13.0.7 (2023-02-04)
2
+ * Fix #573 (Charlie Savage)
3
+
1
4
  == 13.0.6 (2023-02-04)
2
5
  * Fix #577 (Charlie Savage)
3
6
 
@@ -29,7 +29,7 @@ module ActiveRecord
29
29
  stmt.key = table[primary_key]
30
30
 
31
31
  # CPK
32
- if @klass.composite? && @klass.connection.visitor.compile(stmt.ast) =~ /['"]#{primary_key.to_s}['"]/
32
+ if @klass.composite?
33
33
  stmt = Arel::UpdateManager.new
34
34
  stmt.table(arel_table)
35
35
  cpk_subquery(stmt)
@@ -74,7 +74,7 @@ module ActiveRecord
74
74
  stmt.key = table[primary_key]
75
75
 
76
76
  # CPK
77
- if @klass.composite? && @klass.connection.visitor.compile(stmt.ast) =~ /['"]#{primary_key.to_s}['"]/
77
+ if @klass.composite?
78
78
  stmt = Arel::DeleteManager.new
79
79
  stmt.from(arel_table)
80
80
  cpk_subquery(stmt)
@@ -2,7 +2,7 @@ module CompositePrimaryKeys
2
2
  module VERSION
3
3
  MAJOR = 13
4
4
  MINOR = 0
5
- TINY = 6
5
+ TINY = 7
6
6
  STRING = [MAJOR, MINOR, TINY].join('.')
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: composite_primary_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 13.0.6
4
+ version: 13.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Savage
@@ -171,7 +171,6 @@ files:
171
171
  - test/test_associations.rb
172
172
  - test/test_attribute_methods.rb
173
173
  - test/test_attributes.rb
174
- - test/test_bug.rb
175
174
  - test/test_calculations.rb
176
175
  - test/test_callbacks.rb
177
176
  - test/test_composite_arrays.rb
@@ -227,7 +226,6 @@ test_files:
227
226
  - test/test_associations.rb
228
227
  - test/test_attribute_methods.rb
229
228
  - test/test_attributes.rb
230
- - test/test_bug.rb
231
229
  - test/test_calculations.rb
232
230
  - test/test_callbacks.rb
233
231
  - test/test_composite_arrays.rb
data/test/test_bug.rb DELETED
@@ -1,45 +0,0 @@
1
- require File.expand_path('../abstract_unit', __FILE__)
2
-
3
- require "bundler/inline"
4
-
5
-
6
- require "minitest/autorun"
7
- require "logger"
8
-
9
- # This connection will do for database-independent bug reports.
10
- ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
11
- ActiveRecord::Base.logger = Logger.new(STDOUT)
12
-
13
- ActiveRecord::Schema.define do
14
- create_table :parents, force: true do |t|
15
- end
16
-
17
- create_table :children, id: false, force: true do |t|
18
- t.bigint :id
19
- t.bigint :parent_id
20
- end
21
- end
22
-
23
- class Parent < ActiveRecord::Base
24
- end
25
-
26
- class Child < ActiveRecord::Base
27
- belongs_to :parent
28
- end
29
-
30
- class BugTest < Minitest::Test
31
- def test_association_stuff
32
- p1 = Parent.create!
33
- p2 = Parent.create!
34
- p3 = Parent.create!
35
- Child.create!(id: 100, parent_id: p1.id)
36
- Child.create!(id: 100, parent_id: p2.id)
37
- Child.create!(id: 100, parent_id: p3.id)
38
-
39
- children = Child.preload(:parent)
40
- # if uncomment following line, this test pass
41
- # children = Child.all
42
- parents = children.map(&:parent)
43
- assert_equal [p1.id, p2.id, p3.id], parents.map(&:id)
44
- end
45
- end