costagent 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/costagent.rb +2 -2
  2. metadata +2 -2
data/lib/costagent.rb CHANGED
@@ -153,7 +153,7 @@ class CostAgent
153
153
  InvoiceItem.new(
154
154
  :id => (item/"id").first.inner_text.to_i,
155
155
  :invoice_id => (item/"invoice-id").first.inner_text.to_i,
156
- :project_id => project.id,
156
+ :project_id => project.nil? ? nil : project.id,
157
157
  :project => project,
158
158
  :item_type => (item/"item-type").first.inner_text,
159
159
  :description => (item/"description").first.inner_text,
@@ -164,7 +164,7 @@ class CostAgent
164
164
  project = self.project((invoice/"project-id").first.inner_text.to_i)
165
165
  Invoice.new(
166
166
  :id => (invoice/"id").first.inner_text.to_i,
167
- :project_id => project.id,
167
+ :project_id => project.nil? ? nil : project.id,
168
168
  :project => project,
169
169
  :description => (invoice/"description").first.inner_text,
170
170
  :reference => (invoice/"reference").text,
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Elliott Draper