cw_sort_order 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/cw_sort_order.rb +3 -2
- metadata +3 -3
data/lib/cw_sort_order.rb
CHANGED
@@ -4,7 +4,7 @@ module CW
|
|
4
4
|
|
5
5
|
# Specifies Sorting Order
|
6
6
|
#
|
7
|
-
# Provides a clean way to express how columns are to be sorted. It also lets you build them in your models and re-use the ordering without having to put them into controllers so you can use them across many controllers. Or you can stick them in controllers and use them across actions. Or you can YAMLize them and put them into databases... Why? I dunno, sounds like a cool idea.
|
7
|
+
# Provides a clean, programmatic way to express how columns are to be sorted. It also lets you build them in your models and re-use the ordering without having to put them into controllers so you can use them across many controllers. Or you can stick them in controllers and use them across actions. Or you can YAMLize them and put them into databases... Why? I dunno, sounds like a cool idea.
|
8
8
|
#
|
9
9
|
# So, this class doesn't actually DO any sorting. It merely represents a cascading sorting order. Think of it like an ORDER BY clause in a SQL Query. It doesn't actually sort, but tells whatever classes that use it how to sort.
|
10
10
|
#
|
@@ -285,7 +285,8 @@ class SortOrder
|
|
285
285
|
# Returns:
|
286
286
|
# (Array) an ordered pair: [column_name,:asc|:desc]
|
287
287
|
def shift
|
288
|
-
@ordering.shift
|
288
|
+
t = @ordering.shift
|
289
|
+
[t.keys.first,t.values.first] unless t.nil?
|
289
290
|
end
|
290
291
|
|
291
292
|
# Select
|
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: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christopher Wojno
|