From d84a05a6c64541aa4e512b16d319486cc706518c Mon Sep 17 00:00:00 2001 From: Sergey Gridasov Date: Wed, 4 Sep 2013 10:59:46 +0400 Subject: [PATCH] Make additional_data available too. --- lib/pipedrive/base.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/pipedrive/base.rb b/lib/pipedrive/base.rb index 376366a..404e5c4 100644 --- a/lib/pipedrive/base.rb +++ b/lib/pipedrive/base.rb @@ -32,10 +32,16 @@ class Base < OpenStruct # @return [CloudApp::Base] def initialize(attrs = {}) if attrs['data'] - super( attrs['data'] ) + struct_attrs = attrs['data'] + + if attrs['additional_data'] + struct_attrs.merge!(attrs['additional_data']) + end else - super(attrs) + struct_attrs = attrs end + + super(struct_attrs) end # Updates the object.