newellista-searchlogic 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 2
3
3
  :minor: 0
4
- :patch: 5
4
+ :patch: 6
@@ -20,10 +20,14 @@ module Searchlogic
20
20
  options[:ascend_scope] ||= "ascend_by_#{options[:by]}"
21
21
  options[:descend_scope] ||= "descend_by_#{options[:by]}"
22
22
 
23
- ascending = search.order.to_s == options[:ascend_scope]
24
-
25
- tri_state = options[:tri_state].to_s == "true"
26
- new_scope = ascending ? options[:descend_scope] : ( tri_state ? "" : options[:ascend_scope] )
23
+ if options[:tri_state].to_s == "true"
24
+ new_scope = "" if search.order.empty?
25
+ new_scope = options[ :descend_scope ] if search.order.to_s == options[ :ascend_scope ]
26
+ new_scope ||= options[ :ascend_scope ]
27
+ else
28
+ ascending = search.order.to_s == options[:ascend_scope]
29
+ new_scope = ascending ? options[:descend_scope] : options[:ascend_scope]
30
+ end
27
31
 
28
32
  selected = [options[:ascend_scope], options[:descend_scope]].include?(search.order.to_s)
29
33
  if selected
data/searchlogic.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{searchlogic}
5
- s.version = "2.0.5"
5
+ s.version = "2.0.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Ben Johnson of Binary Logic"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newellista-searchlogic
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Johnson of Binary Logic