lib/hubspot/deal.rb in hubspot-ruby-0.8.1 vs lib/hubspot/deal.rb in hubspot-ruby-0.9.0
- old
+ new
@@ -20,14 +20,15 @@
attr_reader :deal_id
attr_reader :company_ids
attr_reader :vids
def initialize(response_hash)
+ props = response_hash['properties'] || {}
+ @properties = Hubspot::Utils.properties_to_hash(props)
@portal_id = response_hash["portalId"]
@deal_id = response_hash["dealId"]
@company_ids = response_hash["associations"]["associatedCompanyIds"]
@vids = response_hash["associations"]["associatedVids"]
- @properties = Hubspot::Utils.properties_to_hash(response_hash["properties"])
end
class << self
def create!(portal_id, company_ids, vids, params={})
#TODO: clean following hash, Hubspot::Utils should do the trick