scoped-search 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -122,7 +122,7 @@ Then in your views, you may use the order_for_scoped_search view helper like thi
122
122
  h2. Issue with single Array attribute and multi parameters scopes
123
123
 
124
124
  When you define a scope, you may define it with a single value that accepts an array, or as a multi parameters scope.
125
- But I haven't find an easy way yet to know the number of parameters a scope accepts (if you know, please tell me!).
125
+ But I haven't found an easy way yet to know the number of parameters a scope accepts (if you know, please tell me!).
126
126
  So, for now, if you pass an array to a scoped attribute, it will be passed as an array to the scope.
127
127
  If you set attributename_multi_params to true, it will be passed as multiple params to the scope.
128
128
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
@@ -36,7 +36,7 @@ class ScopedSearch
36
36
  attributes.reject { |k,v| v.blank? || EXCLUDED_SCOPES_VALUES.include?(v.to_s) }.inject(model_class) do |s, k|
37
37
  if model_class.scopes.keys.include?(k.first.to_sym)
38
38
 
39
- if k.size == 2 && SINGLE_SCOPES_VALUES.include?(k.last.to_s)
39
+ if k.size == 2 && !k.last.is_a?(Array) && SINGLE_SCOPES_VALUES.include?(k.last.to_s)
40
40
  s.send(k.first)
41
41
  else
42
42
  multi_params?(k.first) ? s.send(*k.flatten) : s.send(k.first, k[1..-1].flatten)
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{scoped-search}
8
- s.version = "0.5.0"
8
+ s.version = "0.6.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["slainer68"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scoped-search
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 5
8
+ - 6
9
9
  - 0
10
- version: 0.5.0
10
+ version: 0.6.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - slainer68