Sha256: c3e96af63e242f4bfa66d4a8412f6fda2e22f661e3a77d802161cfb38d508877
Contents?: true
Size: 709 Bytes
Versions: 6
Compression:
Stored size: 709 Bytes
Contents
module Restly::Base::Instance::Actions def save run_callbacks :save do @previously_changed = changes @changed_attributes.clear new_record? ? create : update end self end def delete response = connection.delete(path_with_format, params: params) freeze response.status < 300 end def destroy run_callbacks :destroy do delete end end private def update run_callbacks :update do set_response(connection.put path_with_format, body: @request_body, params: params) end end def create run_callbacks :create do set_response(connection.post path_with_format, body: @request_body, params: params) end end end
Version data entries
6 entries across 6 versions & 1 rubygems