You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is here to track the efforts to fix this issue. It seems both above PRs are stalled.
Steps to reproduce
# config/initializers/000_some_initializer.rb
ActiveRecord::Base.configurations # Make use of AR::Base which hasn't been loaded yet
# config/initializers/new_framework_defaults.rb
Rails.application.config.active_record.collection_cache_versioning = false
# Setting this configuration won't do anything since ActiveRecord::Base is already
# loaded and the `set_configs` initializer has already iterated over application
# config (see https://github.com/rails/rails/blob/b67785a476cf346b09f5ebc71b4d61aae3ac27b3/activerecord/lib/active_record/railtie.rb#L192)
puts ActiveRecord::Base.collection_cache_versioning # true
Expected behavior
Rails would warn on stderr about this problem, or raise an error.
Extra points, if it could pinpoint (stacktrace?) what code is doing the wrong loading.
Actual behavior
Initializer configuration from new_framework_defaults of ActiveRecord is ignored.
System configuration
Rails version:
7.1.2 Ruby version:
2.7.7
The text was updated successfully, but these errors were encountered:
If you use a gem that loads the Rails framework too early, you will get various problems.
Examples of issues that are caused by gems loading Rails incorrectly (from #46047 (comment))
Fixes to gems that loaded Rails too early
Delayed::Job
no longer defined in initializers collectiveidea/delayed_job_active_record#185Pull requests that try to make Rails warn about this problem, when your Rails code has been loaded too early
This issue is here to track the efforts to fix this issue. It seems both above PRs are stalled.
Steps to reproduce
Expected behavior
Rails would warn on stderr about this problem, or raise an error.
Extra points, if it could pinpoint (stacktrace?) what code is doing the wrong loading.
Actual behavior
Initializer configuration from new_framework_defaults of ActiveRecord is ignored.
System configuration
Rails version:
7.1.2
Ruby version:
2.7.7
The text was updated successfully, but these errors were encountered: