[#2622] Change displayed_fields to proper JSONB
This commit is contained in:
parent
a3cb2356cf
commit
68608307ad
4 changed files with 12 additions and 11 deletions
|
@ -102,11 +102,9 @@ module NewGestionnaire
|
|||
fields = values.map do |value|
|
||||
table, column = value.split("/")
|
||||
|
||||
c = procedure.fields.find do |field|
|
||||
procedure.fields.find do |field|
|
||||
field['table'] == table && field['column'] == column
|
||||
end
|
||||
|
||||
c.to_json
|
||||
end
|
||||
|
||||
procedure_presentation.update(displayed_fields: fields)
|
||||
|
|
|
@ -1,12 +1,6 @@
|
|||
class ProcedurePresentation < ApplicationRecord
|
||||
belongs_to :assign_to
|
||||
|
||||
def displayed_fields
|
||||
read_attribute(:displayed_fields).map do |field|
|
||||
field = JSON.parse(field)
|
||||
end
|
||||
end
|
||||
|
||||
def sort
|
||||
JSON.parse(read_attribute(:sort))
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue