vault-rails 0.0.4 → 0.0.5
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.
data/lib/vault-rails/version.rb
CHANGED
@@ -139,7 +139,7 @@ class Vault
|
|
139
139
|
# Merge in the updated attributes, if they're specified and defined on the object.
|
140
140
|
if attributes?
|
141
141
|
for attribute, value of attributes
|
142
|
-
if object[attribute]?
|
142
|
+
if object[attribute]?
|
143
143
|
object[attribute] = value
|
144
144
|
|
145
145
|
# Store the collection.
|
@@ -257,12 +257,19 @@ class Vault
|
|
257
257
|
url: @urls.create
|
258
258
|
data: packaged_object
|
259
259
|
fixture: (settings) =>
|
260
|
-
|
261
|
-
|
262
|
-
|
260
|
+
return {
|
261
|
+
id: 123
|
262
|
+
make: "Dodge",
|
263
|
+
model: "Viper SRT-10",
|
264
|
+
year: 2008}
|
263
265
|
success: (data) =>
|
264
|
-
#
|
265
|
-
|
266
|
+
# Unlock the vault prematurely so that we can update it.
|
267
|
+
@locked = false
|
268
|
+
|
269
|
+
# Update the object with the attributes sent from the server.
|
270
|
+
object.update data, object.id
|
271
|
+
|
272
|
+
object.status = "clean"
|
266
273
|
@dirty_object_count--
|
267
274
|
error: =>
|
268
275
|
@errors.push 'Failed to create.'
|
@@ -487,7 +494,7 @@ class Vault
|
|
487
494
|
# Merge in the updated attributes, if they're specified and defined on the sub-object.
|
488
495
|
if attributes?
|
489
496
|
for attribute, value of attributes
|
490
|
-
if sub_object[attribute]?
|
497
|
+
if sub_object[attribute]?
|
491
498
|
sub_object[attribute] = value
|
492
499
|
|
493
500
|
# Store the collection.
|