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)
|
displayed_columns: columns.map(&:h_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
if !sort_to_column_id(sort).in?(column_ids)
|
if !sorted_column.column.in?(columns)
|
||||||
default_column_id = procedure.dossier_id_column.id
|
update(sorted_column: nil)
|
||||||
update_sort(default_column_id, "desc")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -265,11 +264,6 @@ class ProcedurePresentation < ApplicationRecord
|
||||||
end.reduce(:&)
|
end.reduce(:&)
|
||||||
end
|
end
|
||||||
|
|
||||||
# type_de_champ/4373429
|
|
||||||
def sort_to_column_id(sort)
|
|
||||||
[sort[TABLE], sort[COLUMN]].join(SLASH)
|
|
||||||
end
|
|
||||||
|
|
||||||
def find_type_de_champ(column)
|
def find_type_de_champ(column)
|
||||||
TypeDeChamp
|
TypeDeChamp
|
||||||
.joins(:revision_types_de_champ)
|
.joins(:revision_types_de_champ)
|
||||||
|
|
Loading…
Reference in a new issue