composite_primary_keys 13.0.6 → 13.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.rdoc +3 -0
- data/lib/composite_primary_keys/relation.rb +2 -2
- data/lib/composite_primary_keys/version.rb +1 -1
- metadata +1 -3
- data/test/test_bug.rb +0 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e705c71e8e7a1f2d4aee39d46ba133177960963c2d126ee41caea675ad743dfe
|
4
|
+
data.tar.gz: 266bba1595212c20101e3052cc2a24de8654ce817412b82cfbacee6cf3044c56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80a8ad394e2393f3fbae332a9ba5d8db8bea4484b09834e5ef0749395b188e796e13cab5625688530e4f299464400e2cf0dc67a37f6a27160890cbe08ae8857d
|
7
|
+
data.tar.gz: 48a459a2296938f41a40e98e8f533ae0d7ee8bcd427406dd05af4a1a697466c19e1ba4d4c2212b7d4518e1308ef528ec83f1d52b5b59808016c65d8314c3f074
|
data/History.rdoc
CHANGED
@@ -29,7 +29,7 @@ module ActiveRecord
|
|
29
29
|
stmt.key = table[primary_key]
|
30
30
|
|
31
31
|
# CPK
|
32
|
-
if @klass.composite?
|
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?
|
77
|
+
if @klass.composite?
|
78
78
|
stmt = Arel::DeleteManager.new
|
79
79
|
stmt.from(arel_table)
|
80
80
|
cpk_subquery(stmt)
|
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.
|
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
|