Skip to content
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

(Try again) Fix #5847 and #4045. #6518

Merged
merged 5 commits into from
May 29, 2012
Merged

(Try again) Fix #5847 and #4045. #6518

merged 5 commits into from
May 29, 2012

Conversation

kennyj
Copy link
Contributor

@kennyj kennyj commented May 28, 2012

Previous my fix was reverted (See 0a8aec2 ).
And on master, the AR::Base is already loaded durring initialization.

To resolve original issues and AR::Base loading problem, I added 3 commits.

First: I added a testcase for original issue.
Second: I changed the timing of AR::Base loading (some tests weren't success).
Third: I fixed original issues.

/cc @josevalim

@@ -41,6 +41,7 @@

require APP_PATH
Rails.application.require_environment!
require "active_record/base"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't hardcode Active Record here. Maybe we can provide a hook named runner as we did for rake_tasks, console and so forth. You can find their implementation here:

https://github.com/rails/rails/blob/master/railties/lib/rails/railtie.rb#L136

WDYT? Thanks a lot :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I also searched runner method in rails/railties.rb :-)
I'm going to fix it.
Thanks.

@kennyj
Copy link
Contributor Author

kennyj commented May 29, 2012

@josevalim I updated this PR and added runner hook.

josevalim added a commit that referenced this pull request May 29, 2012
@josevalim josevalim merged commit 9fa3926 into rails:master May 29, 2012
senny added a commit that referenced this pull request Nov 25, 2014
[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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants