update_displayed_fields can use sorted_column
This commit is contained in:
parent
4f0cac251d
commit
249ddf291f
1 changed files with 2 additions and 8 deletions
|
@ -140,9 +140,8 @@ class ProcedurePresentation < ApplicationRecord
|
|||
displayed_columns: columns.map(&:h_id)
|
||||
)
|
||||
|
||||
if !sort_to_column_id(sort).in?(column_ids)
|
||||
default_column_id = procedure.dossier_id_column.id
|
||||
update_sort(default_column_id, "desc")
|
||||
if !sorted_column.column.in?(columns)
|
||||
update(sorted_column: nil)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -265,11 +264,6 @@ class ProcedurePresentation < ApplicationRecord
|
|||
end.reduce(:&)
|
||||
end
|
||||
|
||||
# type_de_champ/4373429
|
||||
def sort_to_column_id(sort)
|
||||
[sort[TABLE], sort[COLUMN]].join(SLASH)
|
||||
end
|
||||
|
||||
def find_type_de_champ(column)
|
||||
TypeDeChamp
|
||||
.joins(:revision_types_de_champ)
|
||||
|
|
Loading…
Reference in a new issue