Module: Ecoportal::API::Common::Content::DoubleModel::DiffableModel
- Extended by:
- Includer
- Included in:
- Ecoportal::API::Common::Content::DoubleModel
- Defined in:
- lib/ecoportal/api/common/content/double_model/diffable_model.rb
Instance Method Summary collapse
-
#as_update ⇒ nil, Hash
The patch
Hashmodel including only the changes betweenoriginal_docanddoc. -
#dirty? ⇒ Boolean
Stating if there are changes.
Methods included from Includer
Instance Method Details
#as_update ⇒ nil, Hash
Returns the patch Hash model including only
the changes between original_doc and doc.
23 24 25 26 27 28 |
# File 'lib/ecoportal/api/common/content/double_model/diffable_model.rb', line 23 def as_update HashDiffPatch.patch_diff( as_json, original_doc ) end |
#dirty? ⇒ Boolean
Returns stating if there are changes.
31 32 33 34 35 36 37 |
# File 'lib/ecoportal/api/common/content/double_model/diffable_model.rb', line 31 def dirty? au = as_update return false if au.nil? return false if au == {} true end |