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

Delete AS::Dependencies.(safe_)constantize #43058

Merged
merged 2 commits into from
Aug 20, 2021
Merged

Delete AS::Dependencies.(safe_)constantize #43058

merged 2 commits into from
Aug 20, 2021

Conversation

fxn
Copy link
Member

@fxn fxn commented Aug 20, 2021

(This is part of the cleanup in ActiveSupport::Dependencies due to the deletion of classic.)

The methods constantize and safe_constantize of ActiveSupport::Dependencies are private. They have nothing to do with autoloading, just forward to the inflector. They were there for historical reasons, but today we no longer need them.

The public interface is in String. So

model_name.constantize

instead of

ActiveSupport::Dependencies.constantize(model_name)

The majority of the framework already did this, there were only a few occurrences.

@fxn fxn merged commit e9f38a1 into main Aug 20, 2021
@fxn fxn deleted the del-private-constantize branch August 20, 2021 16:25
stephenbinns added a commit to gocardless/coach that referenced this pull request Sep 17, 2021
This is removed in rails 7 due to the classic autoloader being removed -
see rails/rails#43058 for details.
stephenbinns added a commit to gocardless/coach that referenced this pull request Sep 17, 2021
This is removed in rails 7 due to the classic autoloader being removed -
see rails/rails#43058 for details.
stephenbinns added a commit to gocardless/coach that referenced this pull request Sep 17, 2021
This is removed in rails 7 due to the classic autoloader being removed -
see rails/rails#43058 for details.
stephenbinns added a commit to gocardless/coach that referenced this pull request Sep 17, 2021
This is removed in rails 7 due to the classic autoloader being removed -
see rails/rails#43058 for details.
tagliala added a commit to tagliala/activeadmin that referenced this pull request Dec 14, 2021
tagliala added a commit to tagliala/activeadmin that referenced this pull request Dec 14, 2021
tagliala added a commit to tagliala/activeadmin that referenced this pull request Dec 14, 2021
tagliala added a commit to tagliala/activeadmin that referenced this pull request Dec 17, 2021
tagliala added a commit to tagliala/activeadmin that referenced this pull request Dec 17, 2021
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

1 participant