abstract_finder 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/abstract_finder/base_finder.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e794b2629b28b8123e3b507bcec0214ee4ebef2b9326fc04d69fcb2b8829f3d4
|
4
|
+
data.tar.gz: 939ef557195630cb238573ed372eacb9eb1658193697bbd37c50560602ce69aa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94b81991070b7320976a68679a4a0c072e06d4a08cc7f8a1f6e3fb40577c3283b5d5967dd3ee012c3a52ba37160e3702821adc54f15e7fab1ef87093d53e4bfb
|
7
|
+
data.tar.gz: 7565167f074c47e6f7dc47e21d1f50df422c8ed4998c332c80b8d4c32dd88d77d387709d5b42b0dd94a200326ec6554b3e78ddb245527e2958707c03c02f1aa6
|
data/README.md
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
|
3
3
|
### API wrapper for search, pagination, filter.
|
4
4
|
|
5
|
-
General idea to pass query, relations to avoid N+1 and permitted params to paginate, filter and sort AbstractFinder collection.
|
5
|
+
General idea to pass a query, relations to avoid N+1 and permitted params to paginate, filter and sort AbstractFinder collection.
|
6
6
|
|
7
7
|
|
8
8
|
``` ruby
|
9
9
|
class RecordsContrroller < Api::BaseController
|
10
10
|
def index
|
11
11
|
finder = AbstractFinder.call(
|
12
|
-
Record.latest,
|
13
|
-
%w[rating status],
|
14
|
-
params
|
12
|
+
Record.latest, # scope, method or class
|
13
|
+
%w[rating status], # to fight N+1
|
14
|
+
params # permitted params for pagination, filtering, ordering and search
|
15
15
|
)
|
16
16
|
|
17
17
|
render json: RecordSerializer.new(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: abstract_finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksei Ivanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: kaminari
|