Don't try to save invalid resources
We were saving the resource after checking it was valid, but it will always return false if the model isn't valid.
This commit is contained in:
@@ -24,10 +24,10 @@ class RemoteTranslations::Caller
|
||||
def destroy_remote_translation
|
||||
if resource.valid?
|
||||
remote_translation.destroy
|
||||
resource.save!
|
||||
else
|
||||
remote_translation.update(error_message: resource.errors.messages)
|
||||
end
|
||||
resource.save
|
||||
end
|
||||
|
||||
def resource
|
||||
|
||||
Reference in New Issue
Block a user