filta 0.8.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +10 -20
- data/Rakefile +4 -5
- data/VERSION +1 -1
- data/lib/filta/methods.rb +1 -6
- metadata +36 -58
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23d769fd7cd1a92c3f7fcaecf96f0dedc2b3b17c7e0a8e4f6d37d3b6aa20b789
|
4
|
+
data.tar.gz: 7ac412d1477c09c4b4bbb108aedc914e84e91add14588196170085795d157450
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b325fc443a3ae4e54762b1df20cae8f8460330dba0380039032bfb932205b90165fe93ba9cc5331855f478f2d21892a99d1b7266247894b5d28a7853570a2239
|
7
|
+
data.tar.gz: 5a47d86aad98e5d88582312f7a893a624fa0d0a4c9e11a178238eddf2035cdc36a45a7d730b78c2a68286c01507b178f4dd513c434a8a236d937914519b33568
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -3,16 +3,7 @@
|
|
3
3
|
Super simple filtering for ActiveRecord, inspired by [Justin Weiss' Gist](https://gist.github.com/justinweiss/9065666).
|
4
4
|
|
5
5
|
[![Gem Version](https://badge.fury.io/rb/filta.svg)](https://badge.fury.io/rb/filta)
|
6
|
-
[![
|
7
|
-
|
8
|
-
<!-- MarkdownTOC -->
|
9
|
-
|
10
|
-
- [Installation](#installation)
|
11
|
-
- [Usage](#usage)
|
12
|
-
- [Contributing](#contributing)
|
13
|
-
- [License](#license)
|
14
|
-
|
15
|
-
<!-- /MarkdownTOC -->
|
6
|
+
[![CircleCI](https://circleci.com/gh/boxt/filta/tree/master.svg?style=svg)](https://circleci.com/gh/boxt/filta/tree/master)
|
16
7
|
|
17
8
|
## Installation
|
18
9
|
|
@@ -52,19 +43,18 @@ If using in a controller make sure you use the `params.permit` method to sanitis
|
|
52
43
|
|
53
44
|
## Notes
|
54
45
|
|
55
|
-
The original `.filter` method is deprecated to avoid any confusion
|
56
|
-
|
46
|
+
The original `.filter` method is deprecated to avoid any confusion
|
57
47
|
|
58
48
|
## Contributing
|
59
49
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
50
|
+
- Check out the latest master and/or develop branches to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
51
|
+
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
52
|
+
- Fork the project
|
53
|
+
- Start a feature/bugfix branch off of develop (using Git Flow approach)
|
54
|
+
- Commit and push until you are happy with your contribution
|
55
|
+
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally
|
56
|
+
- When you are done generate a pull request
|
57
|
+
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
68
58
|
|
69
59
|
## License
|
70
60
|
|
data/Rakefile
CHANGED
@@ -2,11 +2,10 @@
|
|
2
2
|
|
3
3
|
require "bundler/gem_tasks"
|
4
4
|
require "rake/testtask"
|
5
|
+
require "rspec/core/rake_task"
|
5
6
|
|
6
|
-
|
7
|
-
t.
|
8
|
-
t.libs << "lib"
|
9
|
-
t.test_files = FileList["test/**/*_test.rb"]
|
7
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
8
|
+
t.pattern = Dir.glob("spec/**/*_spec.rb")
|
10
9
|
end
|
11
10
|
|
12
|
-
task
|
11
|
+
task test: :spec
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
1.1.2
|
data/lib/filta/methods.rb
CHANGED
@@ -11,18 +11,13 @@ module Filta
|
|
11
11
|
results = where(nil)
|
12
12
|
|
13
13
|
by.each do |key, value|
|
14
|
-
next
|
14
|
+
next if value.blank?
|
15
15
|
|
16
16
|
results = results.where(key.to_s.to_sym => value)
|
17
17
|
end
|
18
18
|
|
19
19
|
results
|
20
20
|
end
|
21
|
-
|
22
|
-
# TODO: This method is now deprecated and should be removed at a later date
|
23
|
-
def filter(by)
|
24
|
-
filta(by)
|
25
|
-
end
|
26
21
|
end
|
27
22
|
end
|
28
23
|
end
|
metadata
CHANGED
@@ -1,155 +1,133 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
8
|
-
autorequire:
|
7
|
+
- Boxt Developers
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '5.2'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
17
|
+
- - ">="
|
25
18
|
- !ruby/object:Gem::Version
|
26
19
|
version: '5.2'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: boxt_ruby_style_guide
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
20
|
- - "~>"
|
32
21
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
34
|
-
type: :
|
22
|
+
version: '6.0'
|
23
|
+
type: :runtime
|
35
24
|
prerelease: false
|
36
25
|
version_requirements: !ruby/object:Gem::Requirement
|
37
26
|
requirements:
|
38
|
-
- - "
|
27
|
+
- - ">="
|
39
28
|
- !ruby/object:Gem::Version
|
40
|
-
version: '2
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: bundler
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '2.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
29
|
+
version: '5.2'
|
52
30
|
- - "~>"
|
53
31
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
32
|
+
version: '6.0'
|
55
33
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
34
|
+
name: boxt_ruby_style_guide
|
57
35
|
requirement: !ruby/object:Gem::Requirement
|
58
36
|
requirements:
|
59
|
-
- -
|
37
|
+
- - '='
|
60
38
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
39
|
+
version: 7.2.0
|
62
40
|
type: :development
|
63
41
|
prerelease: false
|
64
42
|
version_requirements: !ruby/object:Gem::Requirement
|
65
43
|
requirements:
|
66
|
-
- -
|
44
|
+
- - '='
|
67
45
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
46
|
+
version: 7.2.0
|
69
47
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
48
|
+
name: bundler
|
71
49
|
requirement: !ruby/object:Gem::Requirement
|
72
50
|
requirements:
|
73
51
|
- - "~>"
|
74
52
|
- !ruby/object:Gem::Version
|
75
|
-
version: '1
|
53
|
+
version: '2.1'
|
76
54
|
type: :development
|
77
55
|
prerelease: false
|
78
56
|
version_requirements: !ruby/object:Gem::Requirement
|
79
57
|
requirements:
|
80
58
|
- - "~>"
|
81
59
|
- !ruby/object:Gem::Version
|
82
|
-
version: '1
|
60
|
+
version: '2.1'
|
83
61
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
62
|
+
name: rake
|
85
63
|
requirement: !ruby/object:Gem::Requirement
|
86
64
|
requirements:
|
87
65
|
- - "~>"
|
88
66
|
- !ruby/object:Gem::Version
|
89
|
-
version: '0
|
67
|
+
version: '13.0'
|
90
68
|
type: :development
|
91
69
|
prerelease: false
|
92
70
|
version_requirements: !ruby/object:Gem::Requirement
|
93
71
|
requirements:
|
94
72
|
- - "~>"
|
95
73
|
- !ruby/object:Gem::Version
|
96
|
-
version: '0
|
74
|
+
version: '13.0'
|
97
75
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
76
|
+
name: rspec
|
99
77
|
requirement: !ruby/object:Gem::Requirement
|
100
78
|
requirements:
|
101
79
|
- - "~>"
|
102
80
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
81
|
+
version: '3.9'
|
104
82
|
type: :development
|
105
83
|
prerelease: false
|
106
84
|
version_requirements: !ruby/object:Gem::Requirement
|
107
85
|
requirements:
|
108
86
|
- - "~>"
|
109
87
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
88
|
+
version: '3.9'
|
111
89
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
90
|
+
name: rspec-nc
|
113
91
|
requirement: !ruby/object:Gem::Requirement
|
114
92
|
requirements:
|
115
93
|
- - "~>"
|
116
94
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
95
|
+
version: '0.3'
|
118
96
|
type: :development
|
119
97
|
prerelease: false
|
120
98
|
version_requirements: !ruby/object:Gem::Requirement
|
121
99
|
requirements:
|
122
100
|
- - "~>"
|
123
101
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
102
|
+
version: '0.3'
|
125
103
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
104
|
+
name: rspec-rails
|
127
105
|
requirement: !ruby/object:Gem::Requirement
|
128
106
|
requirements:
|
129
107
|
- - "~>"
|
130
108
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
109
|
+
version: '4.0'
|
132
110
|
type: :development
|
133
111
|
prerelease: false
|
134
112
|
version_requirements: !ruby/object:Gem::Requirement
|
135
113
|
requirements:
|
136
114
|
- - "~>"
|
137
115
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
116
|
+
version: '4.0'
|
139
117
|
- !ruby/object:Gem::Dependency
|
140
118
|
name: simplecov
|
141
119
|
requirement: !ruby/object:Gem::Requirement
|
142
120
|
requirements:
|
143
121
|
- - "~>"
|
144
122
|
- !ruby/object:Gem::Version
|
145
|
-
version: '0.
|
123
|
+
version: '0.18'
|
146
124
|
type: :development
|
147
125
|
prerelease: false
|
148
126
|
version_requirements: !ruby/object:Gem::Requirement
|
149
127
|
requirements:
|
150
128
|
- - "~>"
|
151
129
|
- !ruby/object:Gem::Version
|
152
|
-
version: '0.
|
130
|
+
version: '0.18'
|
153
131
|
- !ruby/object:Gem::Dependency
|
154
132
|
name: sqlite3
|
155
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -197,7 +175,7 @@ homepage: https://github.com/boxt/filta
|
|
197
175
|
licenses:
|
198
176
|
- MIT
|
199
177
|
metadata: {}
|
200
|
-
post_install_message:
|
178
|
+
post_install_message:
|
201
179
|
rdoc_options: []
|
202
180
|
require_paths:
|
203
181
|
- lib
|
@@ -205,15 +183,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
205
183
|
requirements:
|
206
184
|
- - ">="
|
207
185
|
- !ruby/object:Gem::Version
|
208
|
-
version: '
|
186
|
+
version: '2.5'
|
209
187
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
210
188
|
requirements:
|
211
189
|
- - ">="
|
212
190
|
- !ruby/object:Gem::Version
|
213
191
|
version: '0'
|
214
192
|
requirements: []
|
215
|
-
rubygems_version: 3.
|
216
|
-
signing_key:
|
193
|
+
rubygems_version: 3.1.4
|
194
|
+
signing_key:
|
217
195
|
specification_version: 4
|
218
196
|
summary: Simple filtering for ActiveRecord
|
219
197
|
test_files: []
|