composite_primary_keys 9.0.7 → 9.0.8

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
  SHA1:
3
- metadata.gz: 935a14ecfff54210eda1de87a8c012555dd8800b
4
- data.tar.gz: aeeecd538f8856ca32f969cfade0dd6124164a34
3
+ metadata.gz: 0bb2d4ed4f66fb5eeaa389046650e232aa16e43c
4
+ data.tar.gz: 796485685e062bd5eb966c9c58385c9d4d9e261b
5
5
  SHA512:
6
- metadata.gz: a00381d95c99145e0a03e0e51051dfe69e09ac699316cfd9e9d2767103db7fa38ba40e00045d257bae284e1875a3dbcdb70e555c4d964b4f3f84ab6583c8e6ab
7
- data.tar.gz: 7eb7dd0107eaa96f8c8adabcd04fe806bf9f40b2aef56469effbd7de01f338f32bed54be8dde25b02cea65364b3c3e3ac38d6f4f4060bdaa12d64c1297d5372b
6
+ metadata.gz: e0ae9ddde5c369743572ae0cc03abc78ba22d9ff1411dbf37e3dc6dc23cc72515502a2958c403c467df1f62c8aaed554269fab712eb30421519e77be58f8c017
7
+ data.tar.gz: fe38741609f9795b001924e889bc24229f654b90615683e2556a97dd7ec3dfdcd3f3cb3f50321a391e70509247a52f158899556fdbc78ee7bc7848e26688bb1a
@@ -1,3 +1,7 @@
1
+ == 9.0.8 (2017-10-11)
2
+
3
+ * Fix Paper Trail compatibility (Sean Linsley)
4
+
1
5
  == 9.0.7 (2017-05-22)
2
6
 
3
7
  * Update sqlite3 to support deletes and updates (Charlie Savage)
@@ -59,9 +59,7 @@ module ActiveRecord
59
59
  attributes = attributes.with_indifferent_access
60
60
  if attributes['id'].blank?
61
61
  unless reject_new_record?(association_name, attributes)
62
- new_record = association.build(attributes.except(*UNASSIGNABLE_KEYS))
63
- public_send("#{self.attributes.keys.first}_will_change!") # TODO CPK: Note: Is this a bug in Rails? We need to somehow set the parent model as changed even when changes are only adding new records to an association. This is not the way to do it, but I am not sure how it should be done.
64
- new_record
62
+ association.build(attributes.except(*UNASSIGNABLE_KEYS))
65
63
  end
66
64
  elsif existing_record = cpk_detect_record(attributes['id'], existing_records)
67
65
  unless call_reject_if(association_name, attributes)
@@ -76,9 +74,7 @@ module ActiveRecord
76
74
  association.add_to_target(existing_record, :skip_callbacks)
77
75
  end
78
76
 
79
- result_from_assign = assign_to_or_mark_for_destruction(existing_record, attributes, options[:allow_destroy])
80
- public_send("#{self.attributes.keys.first}_will_change!") # TODO CPK: Note: Is this a bug in Rails? We need to somehow set the parent model as changed even when changes are only adding new records to an association. This is not the way to do it, but I am not sure how it should be done.
81
- result_from_assign
77
+ assign_to_or_mark_for_destruction(existing_record, attributes, options[:allow_destroy])
82
78
  end
83
79
  else
84
80
  raise_nested_attributes_record_not_found!(association_name, attributes['id'])
@@ -2,7 +2,7 @@ module CompositePrimaryKeys
2
2
  module VERSION
3
3
  MAJOR = 9
4
4
  MINOR = 0
5
- TINY = 7
5
+ TINY = 8
6
6
  STRING = [MAJOR, MINOR, TINY].join('.')
7
7
  end
8
8
  end
@@ -8,7 +8,7 @@ class TestNestedAttributes < ActiveSupport::TestCase
8
8
  code_id = 1001
9
9
 
10
10
  reference_type = reference_types(:name_prefix)
11
- reference_type.update_attribute :reference_codes_attributes, [{
11
+ reference_type.update_attributes :reference_codes_attributes => [{
12
12
  :reference_code => code_id,
13
13
  :code_label => 'XX',
14
14
  :abbreviation => 'Xx'
@@ -20,7 +20,7 @@ class TestNestedAttributes < ActiveSupport::TestCase
20
20
  code_id = 1002
21
21
 
22
22
  reference_type = reference_types(:name_prefix)
23
- reference_type.update_attribute :reference_codes_attributes, [{
23
+ reference_type.update_attributes :reference_codes_attributes => [{
24
24
  :reference_code => code_id,
25
25
  :code_label => 'XX',
26
26
  :abbreviation => 'Xx'
@@ -28,7 +28,7 @@ class TestNestedAttributes < ActiveSupport::TestCase
28
28
 
29
29
  reference_code = ReferenceCode.find_by_reference_code(code_id)
30
30
  cpk = CompositePrimaryKeys::CompositeKeys[reference_type.reference_type_id, code_id]
31
- reference_type.update_attribute :reference_codes_attributes, [{
31
+ reference_type.update_attributes :reference_codes_attributes => [{
32
32
  :id => cpk,
33
33
  :code_label => 'AAA',
34
34
  :abbreviation => 'Aaa'
@@ -71,7 +71,7 @@ class TestNestedAttributes < ActiveSupport::TestCase
71
71
  platform = 'instagram'
72
72
 
73
73
  topic = topics(:music)
74
- topic.update_attribute :topic_sources_attributes, [{
74
+ topic.update_attributes :topic_sources_attributes => [{
75
75
  :platform => platform,
76
76
  :keywords => 'funk'
77
77
  }]
@@ -82,7 +82,7 @@ class TestNestedAttributes < ActiveSupport::TestCase
82
82
  platform = 'instagram'
83
83
 
84
84
  topic = topics(:music)
85
- topic.update_attribute :topic_sources_attributes, [{
85
+ topic.update_attributes :topic_sources_attributes => [{
86
86
  :platform => platform,
87
87
  :keywords => 'funk'
88
88
  }]
@@ -90,7 +90,7 @@ class TestNestedAttributes < ActiveSupport::TestCase
90
90
 
91
91
  topic_source = TopicSource.find_by_platform(platform)
92
92
  cpk = CompositePrimaryKeys::CompositeKeys[topic.id, platform]
93
- topic.update_attribute :topic_sources_attributes, [{
93
+ topic.update_attributes :topic_sources_attributes => [{
94
94
  :id => cpk,
95
95
  :keywords => 'jazz'
96
96
  }]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: composite_primary_keys
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.7
4
+ version: 9.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charlie Savage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-22 00:00:00.000000000 Z
11
+ date: 2017-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -271,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
271
271
  version: '0'
272
272
  requirements: []
273
273
  rubyforge_project:
274
- rubygems_version: 2.6.11
274
+ rubygems_version: 2.6.13
275
275
  signing_key:
276
276
  specification_version: 4
277
277
  summary: Composite key support for ActiveRecord