lib/ecoportal/api/common/doc_helpers.rb in ecoportal-api-0.1.12 vs lib/ecoportal/api/common/doc_helpers.rb in ecoportal-api-0.2.0

- old
+ new

@@ -19,9 +19,12 @@ id ||= doc["external_id"] if doc.is_a?(Hash) id ||= doc if doc.is_a?(String) id or raise "No ID has been given!" id end + def get_external_id(doc) + doc.respond_to?(:external_id) ? doc.external_id : nil + end end end end end