sort = if params['sort']
               case params['sort']
               when 'date' then 'created_on'
               when 'note'   then 'note'
               when 'amount' then 'amount'