Sha256: 05b2784052b4c5159b50f99754219f9379567f9dc5f2f6c7bf7a3a8035aead3c
Contents?: true
Size: 607 Bytes
Versions: 6
Compression:
Stored size: 607 Bytes
Contents
module Panda module Updatable def save new? ? create : update end def save! save || raise(errors.last) end def update_attribute(name, value) send("#{name}=".to_sym, value) && save end def update_attributes(attributes) load(attributes) && save end def update_attributes!(attributes) update_attributes(attributes) || raise(errors.last) end def update uri = replace_pattern_with_self_variables(self.class.one_path) response = connection.put(uri, @changed_attributes) load_and_reset(response) end end end
Version data entries
6 entries across 6 versions & 1 rubygems