Skip to content

Commit

Permalink
Harvest Sync Broken (#104)
Browse files Browse the repository at this point in the history
* initial commit for Harvest Sync broken, fixes #102

* fix null value handling
  • Loading branch information
JensRavens authored Jun 27, 2024
1 parent 86c75c4 commit 3d02f27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/jobs/harvest_import_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ class HarvestImportJob < ApplicationJob
def perform
Project.sync_with_harvest
Invoice.sync_with_harvest
Sprint.within(1.year).find_each(&:sync_with_harvest)
Sprint.within(2.months).find_each(&:sync_with_harvest)
end
end
2 changes: 1 addition & 1 deletion app/models/sprint/harvest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def sync_with_harvest
harvest_entries = HarvestApi.instance.time_entries(from: sprint_from, to: sprint_until)

deleted_ids = time_entries.pluck(:external_id) - harvest_entries.map(&:id)
entries = harvest_entries.map do |e|
entries = harvest_entries.filter_map do |e|
next if user_ids_by_email[e.user].nil?

project_id = project_ids_for_harvest[e.project_id]
Expand Down

0 comments on commit 3d02f27

Please sign in to comment.