Module: DaisybillApi::Ext::CRUD::Update::InstanceMethods
- Defined in:
- lib/daisybill_api/ext/crud/update.rb
Instance Method Summary collapse
-
#save ⇒ Object
Updating a record.
- #update ⇒ Object
Instance Method Details
#save ⇒ Object
Updating a record
pt = DaisybillApi::Models::Patient.find(12) # => <DaisybillApi::Models::Patient id: 12...>
pt.telephone # => "2138888888"
pt.telephone = "2137777777" # => "2137777777"
pt.telephone # => "2137777777"
pt.save # => true
21 22 23 24 25 26 27 |
# File 'lib/daisybill_api/ext/crud/update.rb', line 21 def save return update unless new_record? return create if respond_to? :create = "#save method is not supported for new record" DaisybillApi.logger.error raise NotImplementedError.new end |
#update ⇒ Object
30 31 32 |
# File 'lib/daisybill_api/ext/crud/update.rb', line 30 def update send_data :patch, show_path end |