Issue-138 Add Eager Load Option#139
Merged
rafaelfranca merged 5 commits intorails:mainfrom Aug 30, 2023
Merged
Conversation
|
This is a very valuable feature. Can it be released, please, @rafaelfranca? |
Contributor
Author
|
Hello @rafaelfranca . Should I do something else here or this is ok the way it is now? Thanks in advance |
Member
|
Hey @rafacoello, it seems you forgot to deprecate the locator with only one argument, can you add that? |
156c150 to
b3c1b9d
Compare
Contributor
Author
Hey @rafaelfranca Sorry. I miss-understood the first time. Please let me know if that way is Ok for the deprecation. Thanks! |
bdewater
reviewed
Jan 18, 2023
| return unless gid && find_allowed?(gid.model_class, options[:only]) | ||
|
|
||
| if locator_for(gid).method(:locate).arity == 1 | ||
| warn "#{Kernel.caller.first} warning: method locate(gid) is deprecated. Calling `locate(gid)' is deprecated. Please use `locate(gid, options)' instead." |
There was a problem hiding this comment.
Suggested change
| warn "#{Kernel.caller.first} warning: method locate(gid) is deprecated. Calling `locate(gid)' is deprecated. Please use `locate(gid, options)' instead." | |
| ActiveSupport::Deprecation.warn "Calling `locate(gid)' is deprecated. Please use `locate(gid, options)' instead." |
Also see https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#breaking-changes
fe4ab58 to
bca0e65
Compare
+ added eager load to default locators (in locate and locate_many methods) with backwards compatibility + added tests cases with includes method in use. + created a new stub class for mocking the includes behavior ~ modified Person::Child class to have a relationship called parent.
bca0e65 to
98e02be
Compare
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.
~ Modified Person::Child class to have a relationship called parent.