From a5b8b936d5b6d813593c731d121c1c9a65099940 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Thu, 31 Oct 2024 18:28:47 +0100 Subject: [PATCH] a column can override its column_id --- app/models/column.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/column.rb b/app/models/column.rb index b9c223fe8..c4d54b6c5 100644 --- a/app/models/column.rb +++ b/app/models/column.rb @@ -27,7 +27,7 @@ class Column # the h_id is a Hash and hold enough information to find the column # in the ColumnType class, aka be able to do the h_id -> column conversion - def h_id = { procedure_id: @procedure_id, column_id: "#{table}/#{column}" } + def h_id = { procedure_id: @procedure_id, column_id: } def ==(other) = h_id == other.h_id # using h_id instead of id to avoid inversion of keys @@ -65,6 +65,8 @@ class Column private + def column_id = "#{table}/#{column}" + def typed_value(champ) value = string_value(champ) parse_value(value, type: champ.last_write_column_type)