composite_primary_keys 12.0.0.rc4 → 12.0.0.rc5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/composite_primary_keys/core.rb +7 -8
- data/lib/composite_primary_keys/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84b35b0db707c4adb268b87125ac3d603817b1b939c482f160084be30858330e
|
4
|
+
data.tar.gz: 7a4290f9af7091c393c5abf91f726e5663971663ace04c528925eab61826e78b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d201d2088ca900e7bb5497d640fa34a6ae12d175e55dfeb62080973cfdfe5f573fc5081c6ddc3a704c08050e24ab3c4d731592b662479eafab88add96e4280ba
|
7
|
+
data.tar.gz: 44534a47aeea1d6586818ef55cb0bd697221680e8b20ad82ed36d55b6f81a2ab6e54863064f8da811c095cf5526f65b03cfb52041f41b70eb2dafced7628d82d
|
@@ -1,16 +1,16 @@
|
|
1
1
|
module ActiveRecord
|
2
2
|
module Core
|
3
3
|
def initialize_dup(other) # :nodoc:
|
4
|
-
@attributes = @attributes.
|
4
|
+
@attributes = @attributes.deep_dup
|
5
5
|
# CPK
|
6
|
-
|
6
|
+
#@attributes.reset(@primary_key)
|
7
7
|
Array(self.class.primary_key).each {|key| @attributes.reset(key)}
|
8
8
|
|
9
9
|
_run_initialize_callbacks
|
10
10
|
|
11
11
|
@new_record = true
|
12
12
|
@destroyed = false
|
13
|
-
@_start_transaction_state =
|
13
|
+
@_start_transaction_state = nil
|
14
14
|
@transaction_state = nil
|
15
15
|
|
16
16
|
super
|
@@ -21,9 +21,9 @@ module ActiveRecord
|
|
21
21
|
# We don't have cache keys for this stuff yet
|
22
22
|
return super unless ids.length == 1
|
23
23
|
return super if block_given? ||
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
primary_key.nil? ||
|
25
|
+
scope_attributes? ||
|
26
|
+
columns_hash.key?(inheritance_column) && !base_class?
|
27
27
|
|
28
28
|
# CPK
|
29
29
|
return super if self.composite?
|
@@ -40,8 +40,7 @@ module ActiveRecord
|
|
40
40
|
|
41
41
|
record = statement.execute([id], connection)&.first
|
42
42
|
unless record
|
43
|
-
raise RecordNotFound.new("Couldn't find #{name} with '#{
|
44
|
-
name, primary_key, id)
|
43
|
+
raise RecordNotFound.new("Couldn't find #{name} with '#{key}'=#{id}", name, key, id)
|
45
44
|
end
|
46
45
|
record
|
47
46
|
end
|