lib/active_remote/persistence.rb in active_remote-2.1.0.beta1 vs lib/active_remote/persistence.rb in active_remote-2.1.0.beta2
- old
+ new
@@ -77,11 +77,11 @@
def delete
raise ReadOnlyRemoteRecord if readonly?
response = rpc.execute(:delete, scope_key_hash)
# TODO: add errors here so success? actually does something...
- # add_errors(response)
+ # add_errors(response.errors)
return success? ? freeze : false
end
# Deletes the record from the service (the service determines if the
@@ -103,11 +103,11 @@
def destroy
raise ReadOnlyRemoteRecord if readonly?
response = execute(:destroy, scope_key_hash)
# TODO: add errors here so success? actually does something...
- # add_errors(response)
+ # add_errors(response.errors)
return success? ? freeze : false
end
# Destroys (hard deletes) the record from the service and freezes this
@@ -234,11 +234,11 @@
new_attributes.delete(primary_key.to_s)
response = rpc.execute(:create, new_attributes)
assign_attributes(response.to_hash)
- add_errors(response)
+ add_errors(response.errors)
@new_record = has_errors?
success?
end
end
@@ -264,10 +264,10 @@
updated_attributes.merge!(scope_key_hash)
response = rpc.execute(:update, updated_attributes)
assign_attributes(response.to_hash)
- add_errors(response)
+ add_errors(response.errors)
success?
end
end
end