Fail fast when invalid order given

private-asciicasts
Marcin Kulik 9 years ago
parent 7f90d9e4dc
commit ade94029d6

@ -45,7 +45,7 @@ class Asciicast < ActiveRecord::Base
collection = collection.featured
end
collection = collection.order("#{ORDER_MODES[order]} DESC")
collection = collection.order("#{ORDER_MODES.fetch(order)} DESC")
if page
collection = collection.paginate(page, per_page)

Loading…
Cancel
Save