inst-support-eng / panda-pto

Panda-PTO is a in house solution to HR staffing needs
3 stars 0 forks source link

Deleting Users does not prompt refunds #175

Closed Steaphan-Sadler closed 5 years ago

Steaphan-Sadler commented 5 years ago

When a user is deleted from the users page, it destroys the user's pto requests, rather than prompting the soft_delete action for each of future pto_requests. Because of this, it does not refund agents who have signed up for the same days as the now deleted user.

Instead, it should prompt the refund process for any deleted request.

Steaphan-Sadler commented 5 years ago

line 98 in users controller @user.pto_requests.where('request_date > ?', Date.today).destroy_all looks to cause