filterrific 2.0.2 → 2.0.3
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4b083d6ced83900d819a27094c641df15c8b8eaa
|
|
4
|
+
data.tar.gz: b6792d8a295048001d3def4112b6917edb263293
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c780219e349ac9e7a8aae20db84476c086a1650de029d176268757a5331c3e5924694ff9c856281cc59ed8058d41432f0a675942d2f6b5ac113abf3231310adc
|
|
7
|
+
data.tar.gz: 17e8b121fe5e15ec56a4d34dfae5fbd7906ffb5ebdc506c96a3ba357a405fd1c299f55c54c8750a023586c5a91e1874327add1c8b96512fb08df5294d29eb252
|
data/CHANGELOG.md
CHANGED
|
@@ -25,8 +25,8 @@ module Filterrific
|
|
|
25
25
|
|
|
26
26
|
opts.stringify_keys!
|
|
27
27
|
|
|
28
|
-
define_sorted_by_scope(opts['sorted_by']) if opts['sorted_by']
|
|
29
|
-
#define_search_query_scope(opts['search_query']) if opts['search_query']
|
|
28
|
+
# define_sorted_by_scope(opts['sorted_by']) if opts['sorted_by']
|
|
29
|
+
# define_search_query_scope(opts['search_query']) if opts['search_query']
|
|
30
30
|
|
|
31
31
|
assign_filterrific_available_filters(opts)
|
|
32
32
|
validate_filterrific_available_filters
|
|
@@ -74,9 +74,9 @@ module Filterrific
|
|
|
74
74
|
|
|
75
75
|
# Defines a :sorted_by scope based on attrs
|
|
76
76
|
# @param attrs [Hash] with keys as
|
|
77
|
-
def define_sorted_by_scope(attrs)
|
|
78
|
-
|
|
79
|
-
end
|
|
77
|
+
# def define_sorted_by_scope(attrs)
|
|
78
|
+
# scope :sorted_by, lambda {}
|
|
79
|
+
# end
|
|
80
80
|
|
|
81
81
|
# Assigns available filters.
|
|
82
82
|
# @param opts [Hash] the complete options hash passed to `filterrific`.
|
|
@@ -27,7 +27,7 @@ module Filterrific
|
|
|
27
27
|
# You might wonder "what if I want to change only one thing from the defaults?"
|
|
28
28
|
# Persistence, baby. By the time you submit changes to one filter, all the others
|
|
29
29
|
# will be already initialized with the defaults.
|
|
30
|
-
filterrific_params = model_class.
|
|
30
|
+
filterrific_params = model_class.filterrific_default_filter_params if filterrific_params.blank?
|
|
31
31
|
filterrific_params.stringify_keys!
|
|
32
32
|
filterrific_params = condition_filterrific_params(filterrific_params)
|
|
33
33
|
define_and_assign_attr_accessors_for_each_filter(filterrific_params)
|
data/lib/filterrific/version.rb
CHANGED
|
@@ -56,7 +56,7 @@ module Filterrific
|
|
|
56
56
|
)
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
-
it "raises when no
|
|
59
|
+
it "raises when no available_filters are given" do
|
|
60
60
|
proc {
|
|
61
61
|
Class.new(ActiveRecord::Base) do
|
|
62
62
|
filterrific(
|
|
@@ -66,7 +66,7 @@ module Filterrific
|
|
|
66
66
|
}.must_raise(ArgumentError)
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
-
it "raises when default_settings contains keys that are not in
|
|
69
|
+
it "raises when default_settings contains keys that are not in available_filters" do
|
|
70
70
|
proc {
|
|
71
71
|
Class.new(ActiveRecord::Base) do
|
|
72
72
|
filterrific(
|
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: 2.0.
|
|
4
|
+
version: 2.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jo Hund
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-01-
|
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|