Last active
May 28, 2020 20:00
-
-
Save phsacramento/b161c6126e8935eb2b8b225bbdc9b2ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def handle_invalid_entries(reasons, uid, pid) | |
if reasons.include?(:person_not_registered) | |
@logger.info("[Toggl::TimeEntryImporter] Person not registered: #{uid}") | |
end | |
if reasons.include?(:without_description) | |
@logger.info("[Toggl::TimeEntryImporter] Time entry without description from user #{uid}") | |
end | |
if reasons.include?(:without_project) | |
@logger.info("[Toggl::TimeEntryImporter] Time entry without project from user #{uid}") | |
end | |
return unless reasons.include?(:project_not_registered) | |
@logger.info("[Toggl::TimeEntryImporter] Project not registered: #{pid}") | |
end | |
case reasons | |
in %I[without_description without_project] | |
# do something | |
in %I[person_not_registered project_not_registered] | |
# do something | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment