[#3477] Inline only use of variable

This commit is contained in:
Frederic Merizen 2019-02-26 15:59:46 +01:00 committed by Frederic Merizen
parent 43243e73d4
commit 21128d94b6

View file

@ -75,7 +75,6 @@ class ProcedurePresentation < ApplicationRecord
def sorted_ids(dossiers, gestionnaire)
dossiers.each { |dossier| assert_matching_procedure(dossier) }
table = sort['table']
column = sanitized_column(sort)
order = sort['order']
case table
@ -96,7 +95,7 @@ class ProcedurePresentation < ApplicationRecord
.pluck(:id)
when 'self', 'user', 'individual', 'etablissement'
return (table == 'self' ? dossiers : dossiers.includes(table))
.order("#{column} #{order}")
.order("#{sanitized_column(sort)} #{order}")
.pluck(:id)
end
end