Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MONGOID-5676 [Monkey Patch Removal] Remove Time#configured #5716

Merged
merged 6 commits into from
Nov 8, 2023

Conversation

johnnyshields
Copy link
Contributor

@johnnyshields johnnyshields commented Sep 4, 2023

Fixes MONGOID-5676

Time#configured is a deprecated kernel Monkey Patch. It was originally created to toggle between Ruby's native Time functionality and ActiveSupport::TimeWithZone.

Since Mongoid 7.3-ish Mongoid went all-in on ActiveSupport::TimeWithZone, and this hack was deprecated. It can be simply stripped out with no replacement.

This change will now require that Time.zone be set in the application (or spec_helper, in our case) or an error will be thrown. This is fine--99.99% of Rails apps will have it set, and for the 0.01% that don't its much better to get errors than to accidentally use Ruby's kernel Time which has all sorts of issues.

Overall progress is tracked here: http://tinyurl.com/mongoid-monkey. Refer to MONGOID-5660 for context.

@johnnyshields johnnyshields changed the title [Monkey Patch Removal] Remove Time#configured MONGOID-5676 [Monkey Patch Removal] Remove Time#configured Sep 4, 2023
@jamis jamis merged commit f4b29ce into mongodb:master Nov 8, 2023
15 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants