Last active
July 15, 2024 11:21
-
-
Save alagu/1422f9e493ede9afecb51eab26e1725a to your computer and use it in GitHub Desktop.
amf_goals_delete
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
emails = %w([email protected]) | |
e = User.where(email: emails).map(&:employee) | |
g = Goal.joins(:employee_goals).where(employee_goals: {employee: e}) | |
ga = GoalActivity.where(goal: g, activity_type: [:comment, :progress_checkin]) | |
gp = GoalProgress.where(goal: g) | |
ga.map(&:discard) | |
gp.update(progress_status: "not_started", current_progress: 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment