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

Fix requiring 'active_support/core_ext' by itself #19576

Closed

Conversation

dv
Copy link
Contributor

@dv dv commented Mar 29, 2015

This is a fix for a bug that's in 4.2 stable and beyond. I'm unable to do this:

require 'active_support/core_ext'

To just use the core_ext code. It would throw this error:

activesupport/lib/active_support/number_helper.rb:3:in `<module:NumberHelper>': uninitialized constant ActiveSupport::Autoload (NameError)

This fix also requires this commit made on 4-2-stable but not yet added to master.

Test case:

require 'rubygems'
require 'bundler/setup'

require 'active_support/core_ext'

@simi
Copy link
Contributor

simi commented Mar 29, 2015

@dv dd7bd8c is not needed since it should be removed in master.

@dv
Copy link
Contributor Author

dv commented Mar 29, 2015

What should be removed in master, @simi? Trying to load core_ext from master branch makes it complain:

active_support/core_ext/module/deprecation.rb:21:in deprecate': uninitialized constant ActiveSupport::Deprecation (NameError)`

dd7bd8c fixes that error, and then I bump into the error as described in PR.

@simi
Copy link
Contributor

simi commented Mar 29, 2015

Those requires for active_support/deprecation in dd7bd8c are not needed in master since those deprecations are removed.

@rafaelfranca
Copy link
Member

Thank you for the pull request. Before requiring any file of a rails framework you must require the top level file. In your case you must require active_support first.

@dv
Copy link
Contributor Author

dv commented Mar 29, 2015

Ah that makes sense. It used to work though, probably by accident. Thanks for clarifying!

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.

None yet

3 participants