Module: CurrencyCloud::Actions::Save
- Defined in:
- lib/currency_cloud/actions/save.rb
Instance Method Summary collapse
Instance Method Details
#save ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/currency_cloud/actions/save.rb', line 4 def save return self if changed_attributes.empty? params = attributes.select { |attr| changed_attributes.include?(attr) } attrs = client.post(id, **params) changed_attributes.clear self.attributes = attrs self end |