Cleanup whitespace introduced in 8377646 and f4f6888
This commit is contained in:
parent
8377646d68
commit
89630a7c2c
@ -1100,36 +1100,36 @@ def load(attributes)
|
||||
self
|
||||
end
|
||||
|
||||
# Updates a single attribute and then saves the object.
|
||||
#
|
||||
# Note: Unlike ActiveRecord::Base.update_attribute, this method <b>is</b>
|
||||
# subject to normal validation routines as an update sends the whole body
|
||||
# of the resource in the request. (See Validations).
|
||||
#
|
||||
# As such, this method is equivalent to calling update_attributes with a single attribute/value pair.
|
||||
#
|
||||
# If the saving fails because of a connection or remote service error, an
|
||||
# exception will be raised. If saving fails because the resource is
|
||||
# invalid then <tt>false</tt> will be returned.
|
||||
def update_attribute(name, value)
|
||||
self.send("#{name}=".to_sym, value)
|
||||
self.save
|
||||
end
|
||||
# Updates a single attribute and then saves the object.
|
||||
#
|
||||
# Note: Unlike ActiveRecord::Base.update_attribute, this method <b>is</b>
|
||||
# subject to normal validation routines as an update sends the whole body
|
||||
# of the resource in the request. (See Validations).
|
||||
#
|
||||
# As such, this method is equivalent to calling update_attributes with a single attribute/value pair.
|
||||
#
|
||||
# If the saving fails because of a connection or remote service error, an
|
||||
# exception will be raised. If saving fails because the resource is
|
||||
# invalid then <tt>false</tt> will be returned.
|
||||
def update_attribute(name, value)
|
||||
self.send("#{name}=".to_sym, value)
|
||||
self.save
|
||||
end
|
||||
|
||||
# Updates this resource with all the attributes from the passed-in Hash
|
||||
# and requests that the record be saved.
|
||||
#
|
||||
# If the saving fails because of a connection or remote service error, an
|
||||
# exception will be raised. If saving fails because the resource is
|
||||
# invalid then <tt>false</tt> will be returned.
|
||||
#
|
||||
# Note: Though this request can be made with a partial set of the
|
||||
# resource's attributes, the full body of the request will still be sent
|
||||
# in the save request to the remote service.
|
||||
def update_attributes(attributes)
|
||||
load(attributes) && save
|
||||
end
|
||||
|
||||
# Updates this resource with all the attributes from the passed-in Hash
|
||||
# and requests that the record be saved.
|
||||
#
|
||||
# If the saving fails because of a connection or remote service error, an
|
||||
# exception will be raised. If saving fails because the resource is
|
||||
# invalid then <tt>false</tt> will be returned.
|
||||
#
|
||||
# Note: Though this request can be made with a partial set of the
|
||||
# resource's attributes, the full body of the request will still be sent
|
||||
# in the save request to the remote service.
|
||||
def update_attributes(attributes)
|
||||
load(attributes) && save
|
||||
end
|
||||
# For checking <tt>respond_to?</tt> without searching the attributes (which is faster).
|
||||
alias_method :respond_to_without_attributes?, :respond_to?
|
||||
|
||||
@ -1150,7 +1150,6 @@ def respond_to?(method, include_priv = false)
|
||||
super
|
||||
end
|
||||
|
||||
|
||||
protected
|
||||
def connection(refresh = false)
|
||||
self.class.connection(refresh)
|
||||
|
@ -15,26 +15,21 @@ class Comment < ActiveResource::Base
|
||||
|
||||
module Deeply
|
||||
module Nested
|
||||
|
||||
class Note < ActiveResource::Base
|
||||
self.site = "http://37s.sunrise.i:3000"
|
||||
end
|
||||
|
||||
class Comment < ActiveResource::Base
|
||||
self.site = "http://37s.sunrise.i:3000"
|
||||
end
|
||||
|
||||
module TestDifferentLevels
|
||||
|
||||
class Note < ActiveResource::Base
|
||||
self.site = "http://37s.sunrise.i:3000"
|
||||
end
|
||||
|
||||
end
|
||||
class Comment < ActiveResource::Base
|
||||
self.site = "http://37s.sunrise.i:3000"
|
||||
end
|
||||
|
||||
module TestDifferentLevels
|
||||
class Note < ActiveResource::Base
|
||||
self.site = "http://37s.sunrise.i:3000"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@ -171,6 +166,4 @@ def test_nested_collections_in_different_levels_of_namespaces
|
||||
n = Highrise::Deeply::Nested::TestDifferentLevels::Note.new(:comments => [{ :name => "1" }])
|
||||
assert_kind_of Highrise::Deeply::Nested::Comment, n.comments.first
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user