seek 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
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 : valid_sort_directions.first
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
@@ -2,7 +2,7 @@ class Seek
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -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.0
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-24 00:00:00.000000000 Z
12
+ date: 2013-04-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: positify