composite_primary_keys 12.0.0.rc4 → 12.0.0.rc5

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: ec4037eff014f3dc3de08ec0fecbe5d26e3555fc6dd68a250f717b1b0301c9e5
4
- data.tar.gz: 57a521ac08b5d76a3e7781d3f644cfb574fb48ed32dc611034dfd413fd0375fe
3
+ metadata.gz: 84b35b0db707c4adb268b87125ac3d603817b1b939c482f160084be30858330e
4
+ data.tar.gz: 7a4290f9af7091c393c5abf91f726e5663971663ace04c528925eab61826e78b
5
5
  SHA512:
6
- metadata.gz: d6880df1467fa15dba63e20264a69149d212cfb7c0be4068e6817ad485856894df879b01d76b6f44ba0cb1919986890186d793c638a69396de9434873659f775
7
- data.tar.gz: f63e9d569bbaf62d178979115f61a6eafdb3ad5537e30cb05b6bc791ad3106a99664935a95c6009e88df9d3aeb859d677cda0d9b787b3e06702706f0e3cc2153
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.dup
4
+ @attributes = @attributes.deep_dup
5
5
  # CPK
6
- # @attributes.reset(self.class.primary_key)
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
- primary_key.nil? ||
25
- scope_attributes? ||
26
- columns_hash.include?(inheritance_column)
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 '#{primary_key}'=#{id}",
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
@@ -3,6 +3,6 @@ module CompositePrimaryKeys
3
3
  MAJOR = 12
4
4
  MINOR = 0
5
5
  TINY = 0
6
- STRING = [MAJOR, MINOR, TINY, 'rc4'].join('.')
6
+ STRING = [MAJOR, MINOR, TINY, 'rc5'].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: 12.0.0.rc4
4
+ version: 12.0.0.rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Savage