a column can override its column_id

This commit is contained in:
simon lehericey 2024-10-31 18:28:47 +01:00
parent 83c942c338
commit a5b8b936d5
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5

View file

@ -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)