Permalink
Browse files

do not trigger AR lazy load hook before initializers ran.

[Rafael Mendonça França & Yves Senn]

This require caused the `active_record.set_configs` initializer to
run immediately, before `config/initializers`. This means that setting any
configuration on `Rails.application.config.active_record` inside of
an initializer had no effects when rails was loaded through `rake`.

Introduced by #6518

/cc @rafaelfranca
  • Loading branch information...
senny committed Nov 25, 2014
1 parent c310be0 commit 9e9793b440c044b765f2d1f702feeb92aef2b139
Showing with 0 additions and 2 deletions.
  1. +0 −2 activerecord/lib/active_record/railtie.rb
@@ -36,8 +36,6 @@ class Railtie < Rails::Railtie # :nodoc:
config.eager_load_namespaces << ActiveRecord
rake_tasks do
- require "active_record/base"
-
namespace :db do
task :load_config do
ActiveRecord::Tasks::DatabaseTasks.database_configuration = Rails.application.config.database_configuration

5 comments on commit 9e9793b

@Eric-Guo

This comment has been minimized.

Show comment
Hide comment
@Eric-Guo

Eric-Guo Nov 29, 2014

Contributor

But the problem is it will break rsim/oracle-enhanced#523, so maybe still need?

Contributor

Eric-Guo replied Nov 29, 2014

But the problem is it will break rsim/oracle-enhanced#523, so maybe still need?

@senny

This comment has been minimized.

Show comment
Hide comment
@senny

senny Dec 3, 2014

Member

@Eric-Guo I'd rather not revert this. Can the issue be solved from the oracle adapter gem? /cc @yahonda

Member

senny replied Dec 3, 2014

@Eric-Guo I'd rather not revert this. Can the issue be solved from the oracle adapter gem? /cc @yahonda

@yahonda

This comment has been minimized.

Show comment
Hide comment
@yahonda

yahonda Dec 3, 2014

Contributor

rsim/oracle-enhanced#526 should fix rsim/oracle-enhanced#523. Thanks for the info.

Contributor

yahonda replied Dec 3, 2014

rsim/oracle-enhanced#526 should fix rsim/oracle-enhanced#523. Thanks for the info.

@senny

This comment has been minimized.

Show comment
Hide comment
@senny

senny Dec 3, 2014

Member

@yahonda thank you ❤️ while this leaves oracle user open to the same issue I much prefer to have this outside of Rails and in oracle-enhanced 👍

Member

senny replied Dec 3, 2014

@yahonda thank you ❤️ while this leaves oracle user open to the same issue I much prefer to have this outside of Rails and in oracle-enhanced 👍

@yahonda

This comment has been minimized.

Show comment
Hide comment
@yahonda

yahonda Dec 3, 2014

Contributor

@senny Yeah I think it has high priority to run rake -T than ignoring Rails.application.config.active_record. I have not found the better solution to solve both issues, though.

Contributor

yahonda replied Dec 3, 2014

@senny Yeah I think it has high priority to run rake -T than ignoring Rails.application.config.active_record. I have not found the better solution to solve both issues, though.

Please sign in to comment.