json_api_filter 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile.lock +15 -14
- data/README.md +2 -0
- data/json_api_filter.gemspec +1 -1
- data/lib/json_api_filter.rb +2 -2
- data/lib/json_api_filter/version.rb +1 -1
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2b8ea65bebb5e2456a2009eea40099f2f000a4bc9c83ed79d3d4207c7b86cbdf
|
4
|
+
data.tar.gz: eaaa75be388a45dd56755d47a94956597befeb4db09bd15de5ec8832b047fdef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c383c8c9602a81549fcc45b016b262e07d99c16c90239fcd390057503dbb3773a3ed07ccf86b06157a65b85f0d86e1742dd7465ab9c1c5bd46a0a48c46e8790
|
7
|
+
data.tar.gz: 3c52afa46d6f74466f561af5a7f896a77af6b41440c8b2cac75f11c87a19f1fe26c61bdac86521853dddc8d415b257179a7d65be394083444ad2c6d82b0b4134
|
data/Gemfile.lock
CHANGED
@@ -1,23 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
json_api_filter (0.1.
|
4
|
+
json_api_filter (0.1.1)
|
5
5
|
activesupport (>= 3.0.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (
|
10
|
+
activesupport (6.1.3)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
|
-
i18n (>=
|
13
|
-
minitest (
|
14
|
-
tzinfo (~>
|
15
|
-
|
12
|
+
i18n (>= 1.6, < 2)
|
13
|
+
minitest (>= 5.1)
|
14
|
+
tzinfo (~> 2.0)
|
15
|
+
zeitwerk (~> 2.3)
|
16
|
+
concurrent-ruby (1.1.8)
|
16
17
|
diff-lcs (1.3)
|
17
|
-
i18n (1.
|
18
|
+
i18n (1.8.9)
|
18
19
|
concurrent-ruby (~> 1.0)
|
19
|
-
minitest (5.
|
20
|
-
rake (
|
20
|
+
minitest (5.14.4)
|
21
|
+
rake (13.0.1)
|
21
22
|
rspec (3.9.0)
|
22
23
|
rspec-core (~> 3.9.0)
|
23
24
|
rspec-expectations (~> 3.9.0)
|
@@ -31,9 +32,9 @@ GEM
|
|
31
32
|
diff-lcs (>= 1.2.0, < 2.0)
|
32
33
|
rspec-support (~> 3.9.0)
|
33
34
|
rspec-support (3.9.0)
|
34
|
-
|
35
|
-
|
36
|
-
|
35
|
+
tzinfo (2.0.4)
|
36
|
+
concurrent-ruby (~> 1.0)
|
37
|
+
zeitwerk (2.4.2)
|
37
38
|
|
38
39
|
PLATFORMS
|
39
40
|
ruby
|
@@ -41,8 +42,8 @@ PLATFORMS
|
|
41
42
|
DEPENDENCIES
|
42
43
|
bundler (~> 1.16)
|
43
44
|
json_api_filter!
|
44
|
-
rake (~>
|
45
|
+
rake (~> 13.0)
|
45
46
|
rspec (~> 3.0)
|
46
47
|
|
47
48
|
BUNDLED WITH
|
48
|
-
1.
|
49
|
+
1.17.2
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Filter for rails controller based on JsonAPI spec: `/books?filter[library_id]=1,2&filter[author_id]=12`
|
4
4
|
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/json_api_filter.svg)](https://badge.fury.io/rb/json_api_filter)
|
6
|
+
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
Add this line to your application's Gemfile:
|
data/json_api_filter.gemspec
CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.require_paths = ["lib"]
|
37
37
|
|
38
38
|
spec.add_development_dependency "bundler", "~> 1.16"
|
39
|
-
spec.add_development_dependency "rake", "~>
|
39
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
40
40
|
spec.add_development_dependency "rspec", "~> 3.0"
|
41
41
|
spec.add_dependency "activesupport", ">= 3.0.0"
|
42
42
|
end
|
data/lib/json_api_filter.rb
CHANGED
@@ -14,14 +14,14 @@ module JsonApiFilter
|
|
14
14
|
extend ::ActiveSupport::Concern
|
15
15
|
included do
|
16
16
|
|
17
|
-
def attr_filter(
|
17
|
+
def attr_filter(query_params = params)
|
18
18
|
unless self.class.json_api_permitted_filters.present?
|
19
19
|
raise ::JsonApiFilter::MissingPermittedFilterError
|
20
20
|
end
|
21
21
|
|
22
22
|
::JsonApiFilter::Filters.new(
|
23
23
|
self.class.json_api_permitted_filters,
|
24
|
-
|
24
|
+
query_params
|
25
25
|
).to_hash
|
26
26
|
end
|
27
27
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_api_filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blaked
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '13.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '13.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -111,8 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: '0'
|
113
113
|
requirements: []
|
114
|
-
|
115
|
-
rubygems_version: 2.6.8
|
114
|
+
rubygems_version: 3.0.3
|
116
115
|
signing_key:
|
117
116
|
specification_version: 4
|
118
117
|
summary: Provide a filter for jsonAPI Controller in Rails
|