-
Notifications
You must be signed in to change notification settings - Fork 535
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
V0.11 refactor resource classes to modules #1406
Merged
Merged
Conversation
This file contains 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
…es by way of a `resource_retrieval_strategy` Removes BasicResource class and replaces ActiveRelationResource with a module
Allows retrieval of resources by querying the primary table and joining the source table - the opposite of the v10 version
bf4
reviewed
Sep 7, 2023
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec| | |||
spec.add_development_dependency 'pry' | |||
spec.add_development_dependency 'concurrent-ruby-ext' | |||
spec.add_development_dependency 'database_cleaner' | |||
spec.add_development_dependency 'hashie' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, at least it's dev only :)
bf4
reviewed
Sep 7, 2023
@@ -31,6 +31,8 @@ def test_get_not_found | |||
end | |||
|
|||
def test_post_sessions | |||
skip "This test isn't compatible with v09" if testing_v09? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Add SimpleResource that does not load a resource retrieval strategy module
lgebhardt
added a commit
that referenced
this pull request
Sep 19, 2023
* Restore previous include directives behavior * Default sort use _primary_key * Remove support for pluck attributes * Pass relationship instead of relationship name * Update copyright date * Ignore docker-compose override files * add _relation_name method * Rework resource class to support using modules for retrieving resources by way of a `resource_retrieval_strategy` Removes BasicResource class and replaces ActiveRelationResource with a module * Use `_relationship` helper method * Add ActiveRelationRetrieval Allows retrieval of resources by querying the primary table and joining the source table - the opposite of the v10 version * Skip extra pluck queries when not caching a resource * Test Cleanup * Adjust tested query counts based on default_resource_retrieval_strategy * create_implicit_polymorphic_type_relationships * Add ActiveRelationRetrievalV09 * Move resource down in the load order * Use underscore instead of downcase * Refactor Resource to load retrieval strategy as class loads * Simplify loading resource retrieval strategy modules Add SimpleResource that does not load a resource retrieval strategy module * Remove no longer need deferred_relationship code * Add warning about potentially unused `records_for_populate` * Rework loading the resource_retrieval_strategy to fix issue in real projects * Use SortedSets for resource_identities * Add sorted_set gem * Remove rails 5 support
lgebhardt
added a commit
that referenced
this pull request
Apr 18, 2024
* Restore previous include directives behavior * Default sort use _primary_key * Remove support for pluck attributes * Pass relationship instead of relationship name * Update copyright date * Ignore docker-compose override files * add _relation_name method * Rework resource class to support using modules for retrieving resources by way of a `resource_retrieval_strategy` Removes BasicResource class and replaces ActiveRelationResource with a module * Use `_relationship` helper method * Add ActiveRelationRetrieval Allows retrieval of resources by querying the primary table and joining the source table - the opposite of the v10 version * Skip extra pluck queries when not caching a resource * Test Cleanup * Adjust tested query counts based on default_resource_retrieval_strategy * create_implicit_polymorphic_type_relationships * Add ActiveRelationRetrievalV09 * Move resource down in the load order * Use underscore instead of downcase * Refactor Resource to load retrieval strategy as class loads * Simplify loading resource retrieval strategy modules Add SimpleResource that does not load a resource retrieval strategy module * Remove no longer need deferred_relationship code * Add warning about potentially unused `records_for_populate` * Rework loading the resource_retrieval_strategy to fix issue in real projects * Use SortedSets for resource_identities * Add sorted_set gem * Remove rails 5 support
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.
Putting this up to float the idea of loading the resource retrieval code in modules to allow us manage having the v0.9, v0.10 and v0.11 resource retrieval logic added to the app's Resource derived classes instead of deriving from separate JR created XResource classes.
This PR is definitely not ready to merge. I'm mostly looking for feedback on the last commit, including how we want to name these modules.
All Submissions:
New Feature Submissions:
Bug fixes and Changes to Core Features:
Test Plan:
Reviewer Checklist: