Repository navigation
Read ActiveSupport's time precision when time_precision is not set - #562
Open
erikrozendaal wants to merge 1 commit into
Open
erikrozendaal wants to merge 1 commit into
erikrozendaal wants to merge 1 commit into
Conversation
The default was read from ActiveSupport when Sequent was loaded, so an application that set ActiveSupport's precision afterwards, for example in an initializer, still used the old value in Sequent.
This was referenced Nov 4, 2026
erikrozendaal
marked this pull request as ready for review
November 4, 2026 16:45
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the change to dynamically inherit ActiveSupport’s time precision while preserving explicit overrides.
No open issues 🎉
What changed in this PR
Updates Sequent’s time precision setting to read ActiveSupport’s current value when no explicit override is set, so configuration applied after Sequent loads is respected.
Changes:
- Replaces the load-time default with a dynamic fallback while preserving explicit overrides.
- Adds specs for the fallback and an explicit precision of zero.
- Documents the behavior and removal of
DEFAULT_TIME_PRECISION.
| File | Description |
|---|---|
spec/lib/sequent/configuration_spec.rb |
Tests dynamic fallback and explicit override behavior. |
lib/sequent/configuration.rb |
Adds the fallback getter and removes the cached default. |
docs/docs/concepts/configuration.md |
Clarifies how the default precision is determined. |
CHANGELOG.md |
Records the behavior change and constant removal. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sequent read
ActiveSupport::JSON::Encoding.time_precisiononce, when it was loaded, so an application that set ActiveSupport's precision later, for example in an initializer, kept the old value in Sequent. Without a value of its own,Sequent.configuration.time_precisionnow reads ActiveSupport's current value. This replaces #560: the setting stays, so a follow-up PR can use it for event JSON when Sequent moves from Oj to Ruby'sjsongem.