lib/harvesting/models/project.rb in harvesting-0.2.0 vs lib/harvesting/models/project.rb in harvesting-0.3.0
- old
+ new
@@ -1,19 +1,19 @@
module Harvesting
module Models
- class Project < Base
+ class Project < HarvestRecord
attributed :id,
- :client,
:name,
:code,
:is_active,
:is_billable,
:is_fixed_fee,
:bill_by,
:hourly_rate,
:budget,
:budget_by,
+ :budget_is_monthly,
:notify_when_over_budget,
:over_budget_notification_percentage,
:over_budget_notification_date,
:show_budget_to_all,
:cost_budget,
@@ -23,11 +23,17 @@
:starts_on,
:ends_on,
:created_at,
:updated_at
+ modeled client: Client
+
def path
- id.nil? ? "projects" : "projects/#{id}"
+ @attributes['id'].nil? ? "projects" : "projects/#{@attributes['id']}"
+ end
+
+ def to_hash
+ { client_id: client.id }.merge(super)
end
end
end
end