SRCH-1743 create repository classes #130
Merged
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.
This PR sets up the new Repository classes, which will subsequently be used to store the corresponding
Document
andCollection
instances. The goal is to decouple the model logic from the persistence logic. A detailed explanation of why and how these changes are being made is in:https://www.elastic.co/blog/activerecord-to-repository-changing-persistence-patterns-with-the-elasticsearch-rails-gem
The follow-up commits will build on these repository classes, moving the persistence, serialization, and search logic out of the
Document
andCollection
classes and into the repository classes. (I toyed with retaining theelasticsearch-model
gem, which offers ActiveRecord-y persistence to POROs, but ultimately I agree w/ the recommendation to decouple the model/ persistence logic. It won't surprise me at all if theelasticsearch-model
gem is deprecated in the future, which also makes this a safer route.)