human_value use stable_id ?
This commit is contained in:
parent
4960eda5cb
commit
024cc70667
1 changed files with 5 additions and 2 deletions
|
@ -192,8 +192,7 @@ class ProcedurePresentation < ApplicationRecord
|
|||
def human_value_for_filter(filter)
|
||||
case filter['table']
|
||||
when 'type_de_champ', 'type_de_champ_private'
|
||||
type_de_champ = TypeDeChamp.find_by(id: filter['column'])
|
||||
type_de_champ.dynamic_type.filter_to_human(filter['value'])
|
||||
find_type_de_champ(filter['column']).dynamic_type.filter_to_human(filter['value'])
|
||||
else
|
||||
filter['value']
|
||||
end
|
||||
|
@ -270,6 +269,10 @@ class ProcedurePresentation < ApplicationRecord
|
|||
fields.find { |field| field.values_at('table', 'column') == [table, column] }
|
||||
end
|
||||
|
||||
def find_type_de_champ(column)
|
||||
TypeDeChamp.order(:revision_id).find_by(stable_id: column)
|
||||
end
|
||||
|
||||
def check_allowed_displayed_fields
|
||||
displayed_fields.each do |field|
|
||||
check_allowed_field(:displayed_fields, field)
|
||||
|
|
Loading…
Reference in a new issue