Module: Dbviewer::FormattingHelper

Included in:
ApplicationHelper
Defined in:
app/helpers/dbviewer/formatting_helper.rb

Instance Method Summary collapse

Instance Method Details

#format_cell_value(value, table_name = nil, column_name = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'app/helpers/dbviewer/formatting_helper.rb', line 3

def format_cell_value(value, table_name = nil, column_name = nil)
  # Apply PII masking if configured
  if table_name && column_name
    value = Dbviewer::DataPrivacy::PiiMasker.mask_value(value, table_name, column_name)
  end

  return "NULL" if value.nil?
  return format_default_value(value) unless value.is_a?(String)

  format_string_value(value)
end