cw_sort_order 1.0.3 → 1.0.4
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/cw_sort_order.rb +1 -1
- data/test/test_sort_order.rb +1 -1
- metadata +4 -4
data/lib/cw_sort_order.rb
CHANGED
@@ -352,7 +352,7 @@ class SortOrder
|
|
352
352
|
# Returns:
|
353
353
|
# (String) version of the order as you would specify to a SQL query
|
354
354
|
def to_s
|
355
|
-
self.collect{|col,dir| "
|
355
|
+
self.collect{|col,dir| "#{col} #{dir}"}.join(',')
|
356
356
|
end
|
357
357
|
|
358
358
|
end # SortOrder
|
data/test/test_sort_order.rb
CHANGED
@@ -107,7 +107,7 @@ class PaginationOrderTest < Test::Unit::TestCase
|
|
107
107
|
|
108
108
|
def test_to_s
|
109
109
|
a = CW::SortOrder.new + '1' - '2' - '3' + '4'
|
110
|
-
assert_equal "
|
110
|
+
assert_equal "1 asc,2 desc,3 desc,4 asc", a.to_s
|
111
111
|
end
|
112
112
|
|
113
113
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cw_sort_order
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 31
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 4
|
10
|
+
version: 1.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christopher Wojno
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-18 00:00:00 Z
|
19
19
|
dependencies: []
|
20
20
|
|
21
21
|
description: A construct for representing the sorting order of a set of fields which can be sorted in a cascading fasion. Originally designed for Rails 2.3.14
|