jsonapi-resources-filterer 0.1.0 → 0.1.1
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/CHANGELOG.md +7 -0
- data/README.md +14 -0
- data/bin/rspec +16 -0
- data/jsonapi-resources-filterer.gemspec +1 -0
- data/lib/jsonapi/resources/filterer.rb +8 -0
- data/lib/jsonapi/resources/filterer/version.rb +1 -1
- metadata +18 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 877fc3b98a40562b7aa3b9e6f1f5ebb55baa6392
|
4
|
+
data.tar.gz: dc9528a104c951dc07f6c5dda7f69018b56cdd6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4155d4256fb7af6460b8288aae5f5b66ae65b9500358b25d5c6a7655153b484c8aa5718c01bd4cc5c5b588971eaf6d0f528a68552d76dbeb8ff2880bd67c69af
|
7
|
+
data.tar.gz: 2bbdb00acebf2b65160b69edd7c10cc6c96476ee750787b427ebe4e84ec5394be3eb78e4a007bb1d74703135be4b053f54b7bf3cc50a8ce8018c21f05dfb298e
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
@@ -66,6 +66,20 @@ class ContactFilterer < Filterer::Base
|
|
66
66
|
end
|
67
67
|
```
|
68
68
|
|
69
|
+
## Testing
|
70
|
+
|
71
|
+
```sh
|
72
|
+
# Install gems
|
73
|
+
$ bundle install
|
74
|
+
|
75
|
+
# run specs
|
76
|
+
$ bin/rspec spec
|
77
|
+
# or
|
78
|
+
$ bundle exec rspec spec
|
79
|
+
# or
|
80
|
+
$ rspec spec # can sometimes be slow if not run in the context of Gemfile
|
81
|
+
```
|
82
|
+
|
69
83
|
## Development
|
70
84
|
|
71
85
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/bin/rspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rspec' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rspec-core', 'rspec')
|
@@ -34,6 +34,14 @@ module JSONAPI
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
def apply_filter(records, filter, value, _options = {})
|
38
|
+
if self._filterer
|
39
|
+
self._filterer.chain({filter => value}, {starting_query: records})
|
40
|
+
else
|
41
|
+
super(records, filter, value, _options = {})
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
37
45
|
private
|
38
46
|
|
39
47
|
def filterer_class_from(module_name, class_name)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi-resources-filterer
|
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
|
- G5
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2015-07-
|
13
|
+
date: 2015-07-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: jsonapi-resources
|
@@ -124,6 +124,20 @@ dependencies:
|
|
124
124
|
- - ">="
|
125
125
|
- !ruby/object:Gem::Version
|
126
126
|
version: '0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: database_cleaner
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - "~>"
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '1.4'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - "~>"
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '1.4'
|
127
141
|
description: Integration between filterer and jsonapi-resources
|
128
142
|
email:
|
129
143
|
- lateam@getg5.com
|
@@ -136,12 +150,14 @@ files:
|
|
136
150
|
- ".gitignore"
|
137
151
|
- ".rspec"
|
138
152
|
- ".travis.yml"
|
153
|
+
- CHANGELOG.md
|
139
154
|
- CODE_OF_CONDUCT.md
|
140
155
|
- Gemfile
|
141
156
|
- LICENSE.txt
|
142
157
|
- README.md
|
143
158
|
- Rakefile
|
144
159
|
- bin/console
|
160
|
+
- bin/rspec
|
145
161
|
- bin/setup
|
146
162
|
- jsonapi-resources-filterer.gemspec
|
147
163
|
- lib/jsonapi/resources/filterer.rb
|