deep_unrest 0.1.37 → 0.1.38
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/deep_unrest/application_controller.rb +2 -0
- data/lib/deep_unrest.rb +6 -1
- data/lib/deep_unrest/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: e974c31d347306f0d22490ba09b44150485d9b2015078c4039bfd4b40c4c9ff7
|
4
|
+
data.tar.gz: 54ddf41fab967a1341433f98b53b02f6abd3e984228393b94c74cebe11595834
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c67919a65447a3e7daeb49f320ba29c93e2b0f10375f327cb8a1e08ca2f7ce5f8f7722267ca1544b8ff76153b6acdce99b79597b4313b637fd27347d2fb8e5f3
|
7
|
+
data.tar.gz: de24c2023e94e72e8e6969f6f0fb37cbbc45ff263fefc668cba14171db4d91a44a625879b558880a8ee930e09c47331272ffa08accb4bf8132e98496155a6120
|
data/lib/deep_unrest.rb
CHANGED
@@ -115,8 +115,10 @@ module DeepUnrest
|
|
115
115
|
|
116
116
|
def self.validate_association(parent, type)
|
117
117
|
return unless parent
|
118
|
+
|
118
119
|
reflection = parent[:klass].reflect_on_association(to_assoc(type))
|
119
120
|
raise NoMethodError unless reflection.klass == to_class(type)
|
121
|
+
|
120
122
|
unless parent[:id]
|
121
123
|
raise InvalidParentScope, 'Unable to update associations of collections '\
|
122
124
|
"('#{parent[:type]}.#{type}')."
|
@@ -147,6 +149,7 @@ module DeepUnrest
|
|
147
149
|
unless result.map { |res| res.join('') }.join('.') == path
|
148
150
|
raise InvalidPath, "Invalid path: #{path}"
|
149
151
|
end
|
152
|
+
|
150
153
|
result
|
151
154
|
end
|
152
155
|
|
@@ -215,6 +218,7 @@ module DeepUnrest
|
|
215
218
|
def self.parse_id(id_str)
|
216
219
|
return false if id_str.nil?
|
217
220
|
return id_str if id_str.is_a? Integer
|
221
|
+
|
218
222
|
id_match = id_str.match(/^\.?(?<id>[\w\-]+)$/)
|
219
223
|
id_match && id_match[:id]
|
220
224
|
end
|
@@ -222,6 +226,7 @@ module DeepUnrest
|
|
222
226
|
def self.increment_error_indices(path_info, memo)
|
223
227
|
path_info.each_with_index.map do |(type, id), i|
|
224
228
|
next if i.zero?
|
229
|
+
|
225
230
|
parent_type, parent_id = path_info[i - 1]
|
226
231
|
key = "#{parent_type}#{parent_id}#{type}"
|
227
232
|
memo[key] = [] unless memo[key]
|
@@ -631,7 +636,7 @@ module DeepUnrest
|
|
631
636
|
return {
|
632
637
|
redirect_regex: build_redirect_regex(temp_id_map[uuid]),
|
633
638
|
temp_ids: temp_id_map[uuid],
|
634
|
-
destroyed: destroyed,
|
639
|
+
destroyed: destroyed.map { |d| d.except(:query_uuid) },
|
635
640
|
changed: diff
|
636
641
|
}
|
637
642
|
end
|
data/lib/deep_unrest/version.rb
CHANGED