Last active
March 7, 2023 20:22
-
-
Save mabsboza/8b68e0141c7d275c0a3186151080160a 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
ContractorWorker.all.each do |worker| | |
worker_status = if worker.banished_at? | |
ContractorWorker::Status::DISABLED | |
elsif !worker.approved? | |
ContractorWorker::Status::REJECTED | |
elsif worker.approved? && worker.without_access | |
ContractorWorker::Status::INCOMPLETE | |
elsif worker.approved? && !worker.without_access | |
ContractorWorker::Status::APPROVED | |
else | |
ContractorWorker::Status::PENDING | |
end | |
worker.update(status: worker_status) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment