diff options
Diffstat (limited to 'app/helpers/sort_helper.rb')
-rw-r--r-- | app/helpers/sort_helper.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/helpers/sort_helper.rb b/app/helpers/sort_helper.rb index 9fda5982b..fd797951a 100644 --- a/app/helpers/sort_helper.rb +++ b/app/helpers/sort_helper.rb @@ -89,6 +89,10 @@ module SortHelper sql.blank? ? nil : sql end + def to_a + @criteria.dup + end + def add!(key, asc) @criteria.delete_if {|k,o| k == key} @criteria = [[key, asc]] + @criteria @@ -182,6 +186,10 @@ module SortHelper @sort_criteria.to_sql end + def sort_criteria + @sort_criteria + end + # Returns a link which sorts by the named column. # # - column is the name of an attribute in the sorted record collection. |