Patch #18817 » sort_helper_to_a.patch
app/helpers/sort_helper.rb | ||
---|---|---|
123 | 123 | |
124 | 124 |
def normalize! |
125 | 125 |
@criteria ||= [] |
126 |
@criteria = @criteria.collect {|s| s = s.to_a; [s.first, (s.last == false || s.last == 'desc') ? false : true]}
|
|
126 |
@criteria = @criteria.collect {|s| s = Array(s); [s.first, (s.last == false || s.last == 'desc') ? false : true]}
|
|
127 | 127 |
@criteria = @criteria.select {|k,o| @available_criteria.has_key?(k)} if @available_criteria |
128 | 128 |
@criteria.slice!(3) |
129 | 129 |
self |