Class: Harvesting::Models::ProjectUserAssignment

Inherits:
HarvestRecord show all
Defined in:
lib/harvesting/models/project_user_assignment.rb

Instance Attribute Summary

Attributes inherited from Base

#attributes, #harvest_client

Instance Method Summary collapse

Methods inherited from HarvestRecord

#create, #save, #update

Methods inherited from Base

#create, #delete, #fetch, get, #initialize, #save, #update

Constructor Details

This class inherits a constructor from Harvesting::Models::Base

Instance Method Details

#pathObject



15
16
17
18
# File 'lib/harvesting/models/project_user_assignment.rb', line 15

def path
  base_url = "projects/#{project.id}/user_assignments"
  @attributes['id'].nil? ? base_url : "#{base_url}/#{@attributes['id']}"
end

#to_hashObject



20
21
22
# File 'lib/harvesting/models/project_user_assignment.rb', line 20

def to_hash
  { project_id: project.id, user_id: user.id }.merge(super)
end