Skip to content

Commit

Permalink
Fix breaking order test on 1.9.
Browse files Browse the repository at this point in the history
* Test method name was very confusing, doesn't appear it should be
  preserving an order at all as it passes :pivot_order.
* Added a special case for a :pivot_order => :name as this refers to the
  Grouping name so it's passed through as-is.
  • Loading branch information
Odaeus committed Jan 3, 2013
1 parent f6eadfe commit 8f976ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/ruport/data/table.rb
Expand Up @@ -98,6 +98,8 @@ def self.row_order_to_group_order(row_order_spec)
}
when NilClass
nil
when :name # Pass through :name as it's a special instruction to Grouping
:name
else
proc {|group| group[0][row_order_spec].to_s }
end
Expand Down
2 changes: 1 addition & 1 deletion test/table_pivot_test.rb
Expand Up @@ -107,7 +107,7 @@ def test_preserves_ordering
assert_equal(expected, pivoted)
end

def test_preserves_ordering_on_calculated_column
def test_reorders_a_calculated_column_by_column_name
table = Table('group', 'a')
[
[1, 1], [2, 2], [3, 3]
Expand Down

0 comments on commit 8f976ef

Please sign in to comment.