Ensuring update_attributes cannot be called in CastedModel as per issue #9

This commit is contained in:
Sam Lown 2010-08-24 19:27:35 +02:00
parent c32992c21b
commit fafbfff474
3 changed files with 19 additions and 7 deletions

View file

@ -62,6 +62,20 @@ module CouchRest
end
end
# Update the document's attributes and save. For example:
#
# doc.update_attributes :name => "Fred"
#
# Is the equivilent of doing the following:
#
# doc.attributes = { :name => "Fred" }
# doc.save
#
def update_attributes(hash)
update_attributes_without_saving hash
save
end
protected
def perform_validations(options = {})