seek 0.1.0 → 0.1.1
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.
- data/lib/seek/sorting.rb +1 -1
- data/lib/seek/version.rb +1 -1
- data/spec/lib/seek_spec.rb +4 -0
- metadata +2 -2
data/lib/seek/sorting.rb
CHANGED
@@ -19,7 +19,7 @@ class Seek
|
|
19
19
|
|
20
20
|
def sort_direction
|
21
21
|
result = @sort_direction.to_s.downcase
|
22
|
-
valid_sort_directions.include?(result) ? result :
|
22
|
+
valid_sort_directions.include?(result) ? result : default_sort_direction
|
23
23
|
end
|
24
24
|
|
25
25
|
# Useful for queries that require the format "first_name desc" (such as SQL or lucene)
|
data/lib/seek/version.rb
CHANGED
data/spec/lib/seek_spec.rb
CHANGED
@@ -85,6 +85,10 @@ describe Seek do
|
|
85
85
|
Seek.new.sort_direction.should == 'asc'
|
86
86
|
end
|
87
87
|
|
88
|
+
it 'is the default if speficied' do
|
89
|
+
Seek.new(nil, default_sort_direction: 'desc').sort_direction.should == 'desc'
|
90
|
+
end
|
91
|
+
|
88
92
|
it 'is ascending if something invalid is specified' do
|
89
93
|
Seek.new(sort_direction: 'vertically').sort_direction.should == 'asc'
|
90
94
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: seek
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-04-
|
12
|
+
date: 2013-04-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: positify
|