filterrific 5.0.0 → 5.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +4 -4
- data/doc/scratchpad.md +1 -7
- data/lib/filterrific/action_controller_extension.rb +7 -6
- data/lib/filterrific/active_record_extension.rb +1 -1
- data/lib/filterrific/version.rb +1 -1
- metadata +2 -4
- data/lib/filterrific/engine_api.rb +0 -26
- data/lib/filterrific_api.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cdf8a79ceb47199242045fe675a29bae23a2c05a
|
4
|
+
data.tar.gz: 5f06c14fbc9c712bcf280cd51aaa2b6a45a5377d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef082a1dea5d3c989cd65b032bef0931e5fb75a6d0758f1ee4729b04d019e6e887a4633e9691991da387e9b92bae0c839a868c997d3fcf7947203719ced90bb6
|
7
|
+
data.tar.gz: 8ec955b62c7a8054f9e91ab070a0cdc3154dc37f82fa2583f0df2f561bf31376a52dd74b1fb249021b89f13c571a5e09481f4ba7f636fd316f9ef90927d09227
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
7
7
|
|
8
8
|
Filterrific major versions match the Ruby on Rails major versions they work with.
|
9
9
|
|
10
|
+
## [5.0.1] - Jan. 2, 2018
|
11
|
+
|
12
|
+
* Changed all instances of #deep_stringify_keys back to #stringify_keys. This was changed in 5.0.0, but it shouldn't have been changed.
|
13
|
+
|
10
14
|
## [5.0.0] - Dec. 31, 2017
|
11
15
|
|
12
16
|
* We're switching to a new versioning strategy for Filterrific: Filterrific major releases (the first number in the version) will be matched with the supported major version of Rails. Minor and path versions may diverge from Rails. That means for any version of Rails 5.x you will use the most current version of Filterrific 5.x.
|
data/README.md
CHANGED
@@ -43,9 +43,9 @@ Every commit to Filterrific is automatically tested against the following scenar
|
|
43
43
|
|--------------------|---------------|--------------------------------|------------------------------------|--------------|
|
44
44
|
| 5.x | Rails 5.x | MRI 2.0.0, 2.1.7, 2.2.3, 2.3.1 | mysql2, postgresql |[![Build Status](https://travis-ci.org/jhund/filterrific_demo.svg?branch=rails-5.x)](https://travis-ci.org/jhund/filterrific_demo)|
|
45
45
|
| 4.x | Rails 4.x | MRI 2.0.0, 2.1.7, 2.2.3, 2.3.1 | mysql, mysql2, postgresql, sqlite3 |[![Build Status](https://travis-ci.org/jhund/filterrific_demo.svg?branch=rails-4.x)](https://travis-ci.org/jhund/filterrific_demo)|
|
46
|
-
| 3.x | Rails 3.2 | MRI 2.0.0, 2.1.7 | mysql, mysql2, postgresql, sqlite3 |
|
47
|
-
| 2.x | Rails 3.2 | MRI 1.9.3 | mysql, mysql2, postgresql, sqlite3 |
|
48
|
-
| 1.x | < 3.2 | MRI <= 1.9.3 | mysql, mysql2, postgresql, sqlite3 |
|
46
|
+
| 3.x | Rails 3.2 | MRI 2.0.0, 2.1.7 | mysql, mysql2, postgresql, sqlite3 | Not tested|
|
47
|
+
| 2.x | Rails 3.2 | MRI 1.9.3 | mysql, mysql2, postgresql, sqlite3 | Not tested|
|
48
|
+
| 1.x | < 3.2 | MRI <= 1.9.3 | mysql, mysql2, postgresql, sqlite3 | Not tested|
|
49
49
|
|
50
50
|
### Guidelines for submitting issues
|
51
51
|
|
@@ -85,4 +85,4 @@ If you think you've found a bug, or have a feature request, then create an issue
|
|
85
85
|
|
86
86
|
### Copyright
|
87
87
|
|
88
|
-
Copyright (c) 2010 -
|
88
|
+
Copyright (c) 2010 - 2018 Jo Hund. See [(MIT) LICENSE](https://github.com/jhund/filterrific/blob/master/MIT-LICENSE) for details.
|
data/doc/scratchpad.md
CHANGED
@@ -2,12 +2,7 @@
|
|
2
2
|
|
3
3
|
## TODO
|
4
4
|
|
5
|
-
*
|
6
|
-
* [x] Lock Gemfile to correct version of Rails
|
7
|
-
* [x] Add Rails major version check to filterrific.rb
|
8
|
-
* [ ] In ParamSet#condition_filterrific_params: Why are we type casting integers?
|
9
|
-
* [ ] add check that no filter_name conflicts with existing methods on included ActiveRecord class (See https://github.com/jhund/filterrific/issues/17)
|
10
|
-
* [x] I think this is done: fix reset url, make controller method, helper method
|
5
|
+
* add check that no filter_name conflicts with existing methods on included ActiveRecord class (See https://github.com/jhund/filterrific/issues/17)
|
11
6
|
|
12
7
|
## Travis
|
13
8
|
|
@@ -30,7 +25,6 @@ Ruby 1.8.7
|
|
30
25
|
Ruby 1.9.3
|
31
26
|
Ruby 2.0
|
32
27
|
Ruby 2.1
|
33
|
-
Ruby 2.2 No No No No
|
34
28
|
|
35
29
|
Each combination is also tested for postgres and mysql
|
36
30
|
|
@@ -10,8 +10,9 @@ module Filterrific
|
|
10
10
|
protected
|
11
11
|
|
12
12
|
# @param model_class [Class]
|
13
|
-
# @param filterrific_params [Hash] typically the
|
14
|
-
# the :filterrific key (params[:filterrific]),
|
13
|
+
# @param filterrific_params [ActionController::Params, Hash] typically the
|
14
|
+
# Rails request params under the :filterrific key (params[:filterrific]),
|
15
|
+
# however can be any Hash.
|
15
16
|
# @param opts [Hash, optional]
|
16
17
|
# @option opts [Array<String>, optional] :available_filters
|
17
18
|
# further restrict which of the filters specified in the model are
|
@@ -27,8 +28,8 @@ module Filterrific
|
|
27
28
|
# dynamic values.
|
28
29
|
# @return [Filterrific::ParamSet]
|
29
30
|
def initialize_filterrific(model_class, filterrific_params, opts = {})
|
30
|
-
f_params = (filterrific_params || {}).
|
31
|
-
opts = opts.
|
31
|
+
f_params = (filterrific_params || {}).stringify_keys
|
32
|
+
opts = opts.stringify_keys
|
32
33
|
pers_id = if false == opts['persistence_id']
|
33
34
|
nil
|
34
35
|
else
|
@@ -57,7 +58,7 @@ module Filterrific
|
|
57
58
|
# Computes filterrific params using a number of strategies. Limits params
|
58
59
|
# to 'available_filters' if given via opts.
|
59
60
|
# @param model_class [ActiveRecord::Base]
|
60
|
-
# @param filterrific_params [Hash]
|
61
|
+
# @param filterrific_params [ActionController::Params, Hash]
|
61
62
|
# @param opts [Hash]
|
62
63
|
# @param persistence_id [String, nil]
|
63
64
|
def compute_filterrific_params(model_class, filterrific_params, opts, persistence_id)
|
@@ -66,7 +67,7 @@ module Filterrific
|
|
66
67
|
(persistence_id && session[persistence_id].presence) || # then try session persisted params if persistence_id is present
|
67
68
|
opts['default_filter_params'] || # then use passed in opts
|
68
69
|
model_class.filterrific_default_filter_params # finally use model_class defaults
|
69
|
-
).
|
70
|
+
).stringify_keys
|
70
71
|
r.slice!(*opts['available_filters'].map(&:to_s)) if opts['available_filters']
|
71
72
|
r
|
72
73
|
end
|
@@ -98,7 +98,7 @@ module Filterrific
|
|
98
98
|
def assign_filterrific_default_filter_params(opts)
|
99
99
|
self.filterrific_default_filter_params = (
|
100
100
|
opts['default_filter_params'] || {}
|
101
|
-
).
|
101
|
+
).stringify_keys
|
102
102
|
end
|
103
103
|
|
104
104
|
def validate_filterrific_default_filter_params
|
data/lib/filterrific/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filterrific
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jo Hund
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Filterrific is a Rails Engine plugin that makes it easy to filter, search,
|
14
14
|
and sort your ActiveRecord lists.
|
@@ -37,11 +37,9 @@ files:
|
|
37
37
|
- lib/filterrific/action_view_extension.rb
|
38
38
|
- lib/filterrific/active_record_extension.rb
|
39
39
|
- lib/filterrific/engine.rb
|
40
|
-
- lib/filterrific/engine_api.rb
|
41
40
|
- lib/filterrific/has_reset_filterrific_url_mixin.rb
|
42
41
|
- lib/filterrific/param_set.rb
|
43
42
|
- lib/filterrific/version.rb
|
44
|
-
- lib/filterrific_api.rb
|
45
43
|
- spec/filterrific/action_controller_extension_spec.rb
|
46
44
|
- spec/filterrific/action_view_extension_spec.rb
|
47
45
|
- spec/filterrific/active_record_extension_spec.rb
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
|
3
|
-
require 'filterrific/param_set'
|
4
|
-
|
5
|
-
require 'filterrific/action_controller_extension'
|
6
|
-
require 'filterrific/active_record_extension'
|
7
|
-
|
8
|
-
module Filterrific
|
9
|
-
class EngineApi < ::Rails::Engine
|
10
|
-
|
11
|
-
TODO: Since this is API only, I don't think we need an engine!
|
12
|
-
# It's an engine so that we can add javascript and image assets
|
13
|
-
# to the asset pipeline.
|
14
|
-
|
15
|
-
isolate_namespace Filterrific
|
16
|
-
|
17
|
-
ActiveSupport.on_load :action_controller do
|
18
|
-
include Filterrific::ActionControllerExtension
|
19
|
-
end
|
20
|
-
|
21
|
-
ActiveSupport.on_load :active_record do
|
22
|
-
extend Filterrific::ActiveRecordExtension
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|