lib/pipekit/person.rb in pipekit-1.0.0 vs lib/pipekit/person.rb in pipekit-1.0.1

- old
+ new

@@ -8,12 +8,16 @@ def get_by_name(name) request.get("find", term: name) end - def create_or_update(fields) - person = find_by(email: fields[:email]) + def update_by_email(email, fields) + person = find_by(email: email) update(person["id"], fields) + end + + def create_or_update(fields) + update_by_email(fields[:email], fields) rescue ResourceNotFoundError create(fields) end def find_deals(id)