lib/harvesting/models/contact.rb in harvesting-0.2.0 vs lib/harvesting/models/contact.rb in harvesting-0.3.0

- old
+ new

@@ -1,16 +1,26 @@ module Harvesting module Models - class Contact < Base + class Contact < HarvestRecord attributed :id, :title, :first_name, :last_name, :email, :phone_office, :phone_mobile, :fax, :created_at, :updated_at + + modeled client: Client + + def path + @attributes['id'].nil? ? "contacts" : "contacts/#{@attributes['id']}" + end + + def to_hash + { client_id: client.id }.merge(super) + end end end end