Skip to content

Commit

Permalink
Make additional_data available too.
Browse files Browse the repository at this point in the history
  • Loading branch information
grindars committed Sep 4, 2013
1 parent 3648244 commit d84a05a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/pipedrive/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d84a05a

Please sign in to comment.