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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bb2d4ed4f66fb5eeaa389046650e232aa16e43c
|
4
|
+
data.tar.gz: 796485685e062bd5eb966c9c58385c9d4d9e261b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0ae9ddde5c369743572ae0cc03abc78ba22d9ff1411dbf37e3dc6dc23cc72515502a2958c403c467df1f62c8aaed554269fab712eb30421519e77be58f8c017
|
7
|
+
data.tar.gz: fe38741609f9795b001924e889bc24229f654b90615683e2556a97dd7ec3dfdcd3f3cb3f50321a391e70509247a52f158899556fdbc78ee7bc7848e26688bb1a
|
data/History.rdoc
CHANGED
@@ -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
|
-
|
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
|
-
|
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'])
|
@@ -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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
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-
|
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.
|
274
|
+
rubygems_version: 2.6.13
|
275
275
|
signing_key:
|
276
276
|
specification_version: 4
|
277
277
|
summary: Composite key support for ActiveRecord
|