@@ -107,11 +107,7 @@ def find!(client, options = {})
107107 yield req if block_given?
108108 end
109109
110- new ( client ) . tap do |resource |
111- resource . handle_response ( response )
112- resource . set_includes ( resource , includes , response . body )
113- resource . attributes . clear_changes
114- end
110+ new_from_response ( client , response , includes )
115111 end
116112
117113 # Finds, returning nil if it fails
@@ -157,10 +153,7 @@ def create_many!(client, attributes_array)
157153 yield req if block_given?
158154 end
159155
160- JobStatus . new ( client ) . tap do |resource |
161- resource . handle_response ( response )
162- resource . attributes . clear_changes
163- end
156+ JobStatus . new_from_response ( client , response )
164157 end
165158 end
166159
@@ -218,10 +211,7 @@ def destroy_many!(client, ids)
218211 yield req if block_given?
219212 end
220213
221- JobStatus . new ( client ) . tap do |resource |
222- resource . handle_response ( response )
223- resource . attributes . clear_changes
224- end
214+ JobStatus . new_from_response ( client , response )
225215 end
226216 end
227217
0 commit comments