prefer Active Support's String#safe_constantize to #constantize#297
Merged
prefer Active Support's String#safe_constantize to #constantize#297
Conversation
kbrock
approved these changes
Dec 6, 2023
Collaborator
kbrock
left a comment
There was a problem hiding this comment.
Well, I haven't been able to determine when rails uses constantize and when they use safe_constantize
LGTM
kbrock
added a commit
to kbrock/active_hash
that referenced
this pull request
Apr 29, 2024
- Support `has_many :through` associations active-hash#296 @flavorjones - Rails 7.1 support active-hash#291 @y-yagi - Rails 7.1: fix sqlite3 issue active-hash#303 @flavorjones - Rails 7.1.3: add missing `has_query_constraints?` active-hash#300 @flavorjones - `Array#pluck` supports methods active-hash#299 @iberianpig - Prefer `safe_constantize` over `constantize` active-hash#297 @flavorjones - Treat `nil` and `blank?` as different values active-hash#295 @kbrock - Fix `#where` for string keys active-hash#292 @usernam3
kbrock
added a commit
to kbrock/active_hash
that referenced
this pull request
Apr 29, 2024
- Ruby 3.3 support active-hash#298 @m-nakamura145 - Support `has_many :through` associations active-hash#296 @flavorjones - Rails 7.1 support active-hash#291 @y-yagi - Rails 7.1: fix sqlite3 issue active-hash#303 @flavorjones - Rails 7.1.3: add missing `has_query_constraints?` active-hash#300 @flavorjones - `Array#pluck` supports methods active-hash#299 @iberianpig - Prefer `safe_constantize` over `constantize` active-hash#297 @flavorjones - Treat `nil` and `blank?` as different values active-hash#295 @kbrock - Fix `#where` for string keys active-hash#292 @usernam3
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #296, @kbrock pointed out that Rails uses
String#safe_constantizewhen finding aClassfrom a class name.Functionally I think this will be identical, so maybe there's no good reason to make the change other than "following Rails practices as closely as we can".