Skip to content

Commit

Permalink
Allow symbols to be used for specifying sort columns
Browse files Browse the repository at this point in the history
Signed-off-by: Scott Chacon <[email protected]>
  • Loading branch information
eric authored and schacon committed Dec 29, 2008
1 parent c6a3ede commit 80119f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/munger/report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ def do_field_sort(data)
b = Item.ensure(b)

Data.array(@sort).each do |sorting|
if sorting.is_a? String
compare = a[sorting] <=> b[sorting] rescue 0
if sorting.is_a?(String) || sorting.is_a?(Symbol)
compare = a[sorting.to_s] <=> b[sorting.to_s] rescue 0
break if compare != 0
elsif sorting.is_a? Array
key = sorting[0]
Expand Down

0 comments on commit 80119f4

Please sign in to comment.