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

Ensure cache_key is invalidated when updating translations #104

Merged
merged 4 commits into from Sep 30, 2017

Conversation

Projects
None yet
2 participants
@pwim
Collaborator

pwim commented Sep 30, 2017

For the table and key_value backends, this means the model itself is touched when updating a translation.

Fixes #101. Closes #103.

pwim added some commits Sep 23, 2017

Ensure cache_key is invalidated when updating translations
For the table and key_value backends, this means the model itself is
touched when updating a translation.
When testing caching, perform the update 1 second later
MySQL's default precision isn't enough to change the updated_at
otherwise.

pwim added some commits Sep 30, 2017

Only check for changes to translated attributes
Because we're touching when attributes are changed, this sometimes means
these hashes will include updated_at (it appears to vary based on DB and
Rails version).
Only include time helpers when active support is defined
Right now, we're only using them for testing with activerecord. If we
need to use them with sequel, we can add as an explicit dependency.

@shioyama shioyama merged commit c4a7749 into master Sep 30, 2017

3 checks passed

codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@shioyama shioyama deleted the cache-key branch Oct 28, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment