eco-helpers 0.6.11 → 0.6.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f14a745ec8896dcddd2775565f45079b079e40d1
4
- data.tar.gz: 51a45079f0b74c451ea491b8e11bd17ec5fea82e
3
+ metadata.gz: c1e358356be528278f42f84b31c7c424f7b31ea8
4
+ data.tar.gz: 89ba02ced70d6c8bc6c20aad8aeb10de7d13ba7c
5
5
  SHA512:
6
- metadata.gz: 1c71d8db59b184279cdf4e038a85226fadc569106d6e38bba79b5fe327144842da40afd92bc3a6e164b44df92dbc551cfaa8919aadb24d6940e4c7b237134406
7
- data.tar.gz: 7e5c3d4bb4f92e52373efc5d72c749e41e9eb551a8e1c16153f70318e84ec2c9ad42e11ca67dff25e404b5120b2ed2df6d1b73b5635ebe7f1a9f40a59389f828
6
+ metadata.gz: 5006f558bd72e842aea131973da0667ce691ed65f44b1e8230fe555fa0eb648ca82afb6174465ab744869ad0f6952d9ccea9135340b680961200e0929a06d4f0
7
+ data.tar.gz: 416ce02543a5d8fe8493ebcf46c5e5e3bf6ec84e032dfbfe637fd8f635eb32730b07855c5240ae93bb8b6867e11240a469a7694e8818fa0a8dd64032f151bfbd
@@ -55,7 +55,7 @@ module Eco
55
55
  callback = @callbacks[entry]
56
56
  e = entry
57
57
  e = callback.call(entry) if callback
58
- e = nil if as_update(e).empty?
58
+ e = nil if as_update(e).empty? && @type!=:delete
59
59
  e
60
60
  end.compact
61
61
  end
@@ -99,9 +99,13 @@ module Eco
99
99
 
100
100
  def as_update(update)
101
101
  hash = update if update.is_a?(Hash)
102
- hash = update.as_update if update.is_a?(Ecoportal::API::V1::Person)
103
- fields = hash&.dig('details', 'fields')
104
- fields&.map! { |fld| fld&.slice("id", "alt_id", "value") }
102
+ if @type == :delete
103
+ hash = update.as_json.slice("id", "external_id")
104
+ else
105
+ hash = update.as_update if update.is_a?(Ecoportal::API::V1::Person)
106
+ fields = hash&.dig('details', 'fields')
107
+ fields&.map! { |fld| fld&.slice("id", "alt_id", "value") }
108
+ end
105
109
  hash || {}
106
110
  end
107
111
 
data/lib/eco/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Eco
2
- VERSION = "0.6.11"
2
+ VERSION = "0.6.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eco-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.11
4
+ version: 0.6.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oscar Segura