filterrific 5.1.0 → 5.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 805e2e150dc2f940f7a1553b69d1840fa8c63a19
4
- data.tar.gz: 90e9b1385a67e35473b733e6617558d827b3b403
3
+ metadata.gz: 3503569504542aef40ac725cf71644ff6df5eb49
4
+ data.tar.gz: 95cba3781467d0a1c96cdbfd05381afbd27d0e12
5
5
  SHA512:
6
- metadata.gz: 735745de77b4388f221f94eb2f801a6a0ff14d94881807a4320aaeb0a353ea3fc0e5c35d47283f93a60fb298658be0ec5f90bee82f0085c518cc4a06c1815f93
7
- data.tar.gz: a15233320c33c518f9bddeacf8ff9e839f56916f77ce67e07fcb62f4778e3cafd2103464b401ba6382d4360b922c9d008b86d06f534b5f9d252c67b63b03e965
6
+ metadata.gz: d1641bc77e7522db73133f6b7b3f55af5d0ce10240f1da252d498b2ace1c0d6c0967a4c708b0d20a6681de43173d393c8aeba0a389ed653ed3942cefab0d9b9d
7
+ data.tar.gz: 0e4acf669d4aeb877e1ec6132de3adf7a91f94eaa4ecdc552cd2149e2ca705d1096f4c456392a6157fcc0ab740a6c27d8d6ccf650c26f211d70587628e0f8a81
@@ -7,6 +7,11 @@ 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.2.0] - Jul. 21, 2019
11
+
12
+ * Make Filterrific master branch compatible with Rails 5 and 6.
13
+ * Trigger synthetic JS events before and after form submission ajax requests.
14
+
10
15
  ## [5.1.0] - Aug. 3, 2018
11
16
 
12
17
  * Breaking change: all Filterrific params are sanitized by default to prevent XSS attacks. You can disable sanitization (you really shouldn't!) by setting the :sanitize_params option to false when calling #initialize_filterrific in the controller.
data/README.md CHANGED
@@ -39,13 +39,13 @@ to find out more!
39
39
 
40
40
  Every commit to Filterrific is automatically tested against the following scenarios:
41
41
 
42
- |Filterrific version | Rails version | Ruby environments | Database adapters | Build status |
43
- |--------------------|---------------|--------------------------------|------------------------------------|--------------|
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
- | 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 | 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|
42
+ |Filterrific version | Rails version | Ruby environments | Database adapters | Build status |
43
+ |--------------------|----------------|--------------------------------|------------------------------------|--------------|
44
+ | 5.x | Rails 5.x, 6.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
+ | 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 | 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
 
@@ -66,7 +66,8 @@ If you think you've found a bug, or have a feature request, then create an issue
66
66
  ### Resources
67
67
 
68
68
  * [Documentation](http://filterrific.clearcove.ca)
69
- * [Live demo](http://filterrific-demo.herokuapp.com)
69
+ * [Live demo](https://filterrific-demo.herokuapp.com) using classic Rails views.
70
+ * [Live JSON API demo](https://filterrific-json-api-demo.herokuapp.com/) using React and Mobx.
70
71
  * [Changelog](https://github.com/jhund/filterrific/blob/master/CHANGELOG.md)
71
72
  * [Source code (github)](https://github.com/jhund/filterrific)
72
73
  * [Issues](https://github.com/jhund/filterrific/issues)
@@ -85,4 +86,4 @@ If you think you've found a bug, or have a feature request, then create an issue
85
86
 
86
87
  ### Copyright
87
88
 
88
- Copyright (c) 2010 - 2018 Jo Hund. See [(MIT) LICENSE](https://github.com/jhund/filterrific/blob/master/MIT-LICENSE) for details.
89
+ Copyright (c) 2010 - 2019 Jo Hund. See [(MIT) LICENSE](https://github.com/jhund/filterrific/blob/master/MIT-LICENSE) for details.
@@ -21,6 +21,8 @@ if (typeof Filterrific === 'undefined') {
21
21
  Filterrific.submitFilterForm = function(){
22
22
  var form = $(this).parents("form"),
23
23
  url = form.attr("action");
24
+ // send before event
25
+ $(form).trigger('loadingFilterrificResults');
24
26
  // turn on spinner
25
27
  $('.filterrific_spinner').show();
26
28
  // Submit ajax request
@@ -30,6 +32,8 @@ Filterrific.submitFilterForm = function(){
30
32
  type: 'GET',
31
33
  dataType: 'script'
32
34
  }).done(function( msg ) {
35
+ // send after event
36
+ $(form).trigger('loadedFilterrificResults');
33
37
  $('.filterrific_spinner').hide();
34
38
  });
35
39
  };
@@ -2,12 +2,7 @@
2
2
 
3
3
  ## TODO
4
4
 
5
- * [x] Go to deep_stringify_keys (in ActionControllerExtension#initialize_filterrific)
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
 
@@ -1,7 +1,7 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
- if Rails::VERSION::MAJOR != 5
4
- raise "\n\nThis version of Filterrific only works with Rails 5.x.\nPlease see the Filterrific README for the correct version of Filterrific to use with your version of Rails!\n\n"
3
+ if ![5,6].include?(Rails::VERSION::MAJOR)
4
+ raise "\n\nThis version of Filterrific only works with Rails 5 and 6.\nPlease see the Filterrific README for the correct version of Filterrific to use with your version of Rails!\n\n"
5
5
  end
6
6
 
7
7
  require 'filterrific/version'
@@ -96,7 +96,7 @@ module Filterrific
96
96
  fp[key] = val.call
97
97
  when val.is_a?(Array)
98
98
  # type cast integers in the array
99
- fp[key] = fp[key].map { |e| e =~ integer_detector_regex ? e.to_i : e }
99
+ fp[key] = fp[key].map { |e| e =~ integer_detector_regex ? e.to_i : e }.find_all { |e| }
100
100
  when val.is_a?(Hash)
101
101
  # type cast Hash to OpenStruct so that nested params render correctly
102
102
  # in the form
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
3
  module Filterrific
4
- VERSION = "5.1.0"
4
+ VERSION = "5.2.0"
5
5
  end
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.1.0
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jo Hund
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-03 00:00:00.000000000 Z
11
+ date: 2019-07-21 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
@@ -68,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
66
  version: '0'
69
67
  requirements: []
70
68
  rubyforge_project:
71
- rubygems_version: 2.6.11
69
+ rubygems_version: 2.6.14
72
70
  signing_key:
73
71
  specification_version: 4
74
72
  summary: A Rails engine plugin for filtering ActiveRecord lists.
@@ -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
@@ -1,7 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- require 'filterrific/version'
4
- require 'filterrific/engine_api'
5
-
6
- module Filterrific
7
- end