Module: LHS::Item::Save
- Extended by:
- ActiveSupport::Concern
- Included in:
- LHS::Item
- Defined in:
- lib/lhs/concerns/item/save.rb
Instance Method Summary collapse
Instance Method Details
#save(options = nil) ⇒ Object
16 17 18 19 20 |
# File 'lib/lhs/concerns/item/save.rb', line 16 def save( = nil) save!() rescue LHC::Error false end |
#save!(options = {}) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/lhs/concerns/item/save.rb', line 22 def save!( = {}) = .present? ? .dup : {} data = _data._raw.dup url = url_for_persistance!(data, ) create_and_merge_data!( (, url, data) ) rescue LHC::Error => e self.errors = LHS::Problems::Errors.new(e.response, record) raise e end |