sort_helper_to_a.patch

to_a undefined for string - Ondřej Ezr, 2015-01-13 00:22

Download (627 Bytes)

View differences:

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