Class: SQLServerDBI::Type::SqlserverForcedString

Inherits:
Object
  • Object
show all
Defined in:
lib/core_ext/dbi.rb

Overview

The adapter and rails will parse our floats, decimals, and money field correctly from a string. Do not let the DBI::Type classes create Float/BigDecimal objects for us. Trust rails .type_cast to do what it is built to do.

Class Method Summary collapse

Class Method Details

.parse(obj) ⇒ Object



39
40
41
42
# File 'lib/core_ext/dbi.rb', line 39

def self.parse(obj)
  return nil if ::DBI::Type::Null.parse(obj).nil?
  obj.to_s
end