Closed robinjoseph08 closed 8 years ago
Fixes #157
This is to delete all the associated schedules tied to a job when you delete a job. If you delete a schedule individually, it works just fine, but https://github.com/jamesrwhite/minicron/blob/3d33ddabca874d4ade027116678b1dcfaae9de39/lib/minicron/cron.rb#L232-L234 these lines aren't effective because the schedules aren't loaded so job.schedules.length is always 0. I tested this on my own setup and it worked.
job.schedules.length
I would've written some tests, but it doesn't look like Hub tests are implemented just yet :/
@jamesrwhite
Nicely spotted, thanks! I think the same problem exists for deleting a host also but I'm going to merge this and fix that separately.
Fixes #157
This is to delete all the associated schedules tied to a job when you delete a job. If you delete a schedule individually, it works just fine, but https://github.com/jamesrwhite/minicron/blob/3d33ddabca874d4ade027116678b1dcfaae9de39/lib/minicron/cron.rb#L232-L234 these lines aren't effective because the schedules aren't loaded so
job.schedules.length
is always 0. I tested this on my own setup and it worked.I would've written some tests, but it doesn't look like Hub tests are implemented just yet :/
@jamesrwhite