hyper-resource 1.0.0.lap72 → 1.0.0.lap73
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 +4 -4
- data/lib/hyper_record/client_instance_methods.rb +8 -2
- data/lib/hyperloop/resource/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: 6c43ff6d1d2952b093f7a190c13b230d910289b818f0bc3c87c3a45767e6ccc5
|
4
|
+
data.tar.gz: 6ca75608fa5a0a6ab76bfe19900a1f6f4c7888e3f15c6509d17f61a1e469acdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c735b376c83a2b9f29b40521a91689d721c40f70a5cc081315297de78cc676aef5f9aad2be31d68bedb48d15bdd4e211276640a1702a5f2bc5122017d890ec38
|
7
|
+
data.tar.gz: d5acfd716a462567691c9760c435ab5cd0cf50424c0ee404afe124be69446ee6d8d6d5f9fe81e32f8d7f06635dfce5f1c15ca723517a52bbf7b679d181830e6e
|
@@ -147,11 +147,17 @@ module HyperRecord
|
|
147
147
|
called_from_collection = relation_name ? true : false
|
148
148
|
relation_name = other_record.class.to_s.underscore.pluralize unless relation_name
|
149
149
|
if reflections.has_key?(relation_name)
|
150
|
-
|
150
|
+
if !called_from_collection && @fetch_states[relation_name] == 'f'
|
151
|
+
@relations[relation_name] = HyperRecord::Collection.new([], self, relation_name) if @relations[relation_name].nil?
|
152
|
+
@relations[relation_name].push(other_record)
|
153
|
+
end
|
151
154
|
else
|
152
155
|
relation_name = other_record.class.to_s.underscore
|
153
156
|
raise "No collection for record of type #{other_record.class}" unless reflections.has_key?(relation_name)
|
154
|
-
|
157
|
+
if !called_from_collection && @fetch_states[relation_name] == 'f'
|
158
|
+
@relations[relation_name] = HyperRecord::Collection.new([], self, relation_name) if @relations[relation_name].nil?
|
159
|
+
@relations[relation_name].push(other_record)
|
160
|
+
end
|
155
161
|
end
|
156
162
|
payload_hash = other_record.to_hash
|
157
163
|
self.class._promise_post("#{resource_base_uri}/#{self.id}/relations/#{relation_name}.json", { data: payload_hash }).then do |response|
|