Method: ActiveRecord::ConnectionAdapters::Column.value_to_boolean

Defined in:
activerecord/lib/active_record/connection_adapters/column.rb

+ (Object) value_to_boolean(value)

convert something to a boolean



170
171
172
173
174
175
176
# File 'activerecord/lib/active_record/connection_adapters/column.rb', line 170

def value_to_boolean(value)
  if value.is_a?(String) && value.empty?
    nil
  else
    TRUE_VALUES.include?(value)
  end
end

Comments