Sha256: 97ebb2baa6b81db4ef0033f801b8b8dfc023ba40a45fadf6d3cadaaa9d71714a

Contents?: true

Size: 624 Bytes

Versions: 4

Compression:

Stored size: 624 Bytes

Contents

module Harvesting
  module Models
    class ProjectUserAssignment < HarvestRecord
      attributed :id,
                 :is_active,
                 :is_project_manager,
                 :hourly_rate,
                 :budget,
                 :created_at,
                 :updated_at

      modeled project: Project,
              user: User

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
harvesting-0.6.0 lib/harvesting/models/project_user_assignment.rb
harvesting-0.5.1 lib/harvesting/models/project_user_assignment.rb
harvesting-0.5.0 lib/harvesting/models/project_user_assignment.rb
harvesting-0.4.0 lib/harvesting/models/project_user_assignment.rb