Class: SpreadsheetBuilder::BooleanColumn

Inherits:
StringColumn show all
Defined in:
backend/app/model/spreadsheet_builder.rb

Instance Attribute Summary

Attributes inherited from StringColumn

#column, #index, #jsonmodel, #locked, #name, #property_name, #width

Instance Method Summary collapse

Methods inherited from StringColumn

#header_label, #initialize, #path

Constructor Details

This class inherits a constructor from SpreadsheetBuilder::StringColumn

Instance Method Details

#sanitise_incoming_value(value) ⇒ Object



143
144
145
146
147
# File 'backend/app/model/spreadsheet_builder.rb', line 143

def sanitise_incoming_value(value)
  return nil if value.to_s.empty?

  value == 'true'
end

#value_for(column_value) ⇒ Object



139
140
141
# File 'backend/app/model/spreadsheet_builder.rb', line 139

def value_for(column_value)
  (column_value == 1).to_s
end