Ask A Question

Notifications

You’re not receiving notifications from this thread.

Refactoring with ActiveSupport::TimeWithZone Discussion

Much cleaner to read and I don't think people (like myself) use these helpers enough!

Reply

Agreed!

Reply

Surely active? should be started? && !ended?

Reply

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!

Reply

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?

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.