mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix punctuation errors.
This commit is contained in:
parent
ca608b8c9c
commit
31110c50e4
1 changed files with 5 additions and 5 deletions
|
@ -8,9 +8,9 @@ module ActiveResource
|
||||||
# Active Resource validation is reported to and from this object, which is used by Base#save
|
# Active Resource validation is reported to and from this object, which is used by Base#save
|
||||||
# to determine whether the object in a valid state to be saved. See usage example in Validations.
|
# to determine whether the object in a valid state to be saved. See usage example in Validations.
|
||||||
class Errors < ActiveModel::Errors
|
class Errors < ActiveModel::Errors
|
||||||
# Grabs errors from an array of messages (like ActiveRecord::Validations)
|
# Grabs errors from an array of messages (like ActiveRecord::Validations).
|
||||||
# The second parameter directs the errors cache to be cleared (default)
|
# The second parameter directs the errors cache to be cleared (default)
|
||||||
# or not (by passing true)
|
# or not (by passing true).
|
||||||
def from_array(messages, save_cache = false)
|
def from_array(messages, save_cache = false)
|
||||||
clear unless save_cache
|
clear unless save_cache
|
||||||
humanized_attributes = Hash[@base.attributes.keys.map { |attr_name| [attr_name.humanize, attr_name] }]
|
humanized_attributes = Hash[@base.attributes.keys.map { |attr_name| [attr_name.humanize, attr_name] }]
|
||||||
|
@ -73,7 +73,7 @@ module ActiveResource
|
||||||
|
|
||||||
# clear the remote validations so they don't interfere with the local
|
# clear the remote validations so they don't interfere with the local
|
||||||
# ones. Otherwise we get an endless loop and can never change the
|
# ones. Otherwise we get an endless loop and can never change the
|
||||||
# fields so as to make the resource valid
|
# fields so as to make the resource valid.
|
||||||
@remote_errors = nil
|
@remote_errors = nil
|
||||||
if perform_validation && valid? || !perform_validation
|
if perform_validation && valid? || !perform_validation
|
||||||
save_without_validation
|
save_without_validation
|
||||||
|
@ -84,7 +84,7 @@ module ActiveResource
|
||||||
rescue ResourceInvalid => error
|
rescue ResourceInvalid => error
|
||||||
# cache the remote errors because every call to <tt>valid?</tt> clears
|
# cache the remote errors because every call to <tt>valid?</tt> clears
|
||||||
# all errors. We must keep a copy to add these back after local
|
# all errors. We must keep a copy to add these back after local
|
||||||
# validations
|
# validations.
|
||||||
@remote_errors = error
|
@remote_errors = error
|
||||||
load_remote_errors(@remote_errors, true)
|
load_remote_errors(@remote_errors, true)
|
||||||
false
|
false
|
||||||
|
@ -92,7 +92,7 @@ module ActiveResource
|
||||||
|
|
||||||
|
|
||||||
# Loads the set of remote errors into the object's Errors based on the
|
# Loads the set of remote errors into the object's Errors based on the
|
||||||
# content-type of the error-block received
|
# content-type of the error-block received.
|
||||||
def load_remote_errors(remote_errors, save_cache = false ) #:nodoc:
|
def load_remote_errors(remote_errors, save_cache = false ) #:nodoc:
|
||||||
case self.class.format
|
case self.class.format
|
||||||
when ActiveResource::Formats[:xml]
|
when ActiveResource::Formats[:xml]
|
||||||
|
|
Loading…
Reference in a new issue