Refactoring with ActiveSupport::TimeWithZone Discussion
Discussion for
Refactoring with ActiveSupport::TimeWithZone
Surely active? should be started? && !ended?
Yep! There was actually another method below the ones shown in the video that did just that so we didn't do that here (for the active? method). But we have since removed the other method in the codebase and adjusted active? to cover this. Thanks for the comment and sorry for any confusion!
Actually, I take it all back. What we have in the video is what we wanted. Adding started?
caused the code to not function properly. The running?
method that is not shown in the video is where the check for your suggestion lives. So we have since added the running?
method back and reverted active?
to just be end_time.future?