Skip to content

Fix NoMethodError on cache expiry with Rails 7 - #848

Merged
n-rodriguez merged 1 commit into
redmine-git-hosting:masterfrom
SAY-5:fix-default-timezone-rails7
Jul 20, 2026
Merged

Fix NoMethodError on cache expiry with Rails 7#848
n-rodriguez merged 1 commit into
redmine-git-hosting:masterfrom
SAY-5:fix-default-timezone-rails7

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Opening a repository on Redmine 6.1 / Rails 7.2 crashes with NoMethodError (undefined method 'default_timezone' for class ActiveRecord::Base) from AbstractCache#valid_cache_entry?. Rails 7 removed ActiveRecord::Base.default_timezone and moved it to ActiveRecord.default_timezone.

This routes both cache-time checks through a small utc_default_timezone? helper that reads ActiveRecord.default_timezone when available and falls back to the old accessor, so cache expiry keeps working on Rails 7+ as well as older Redmine versions the plugin still supports.

Fixes #847

@n-rodriguez
n-rodriguez merged commit 5a47291 into redmine-git-hosting:master Jul 20, 2026
20 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.

NoMethodError (undefined method `default_timezone' for class ActiveRecord::Base)

2 participants