Class: ActiveRecord::ConnectionAdapters::IBM_DBColumn
- Inherits:
-
Column
- Object
- Column
- ActiveRecord::ConnectionAdapters::IBM_DBColumn
- Defined in:
- lib/active_record/connection_adapters/ibm_db_adapter.rb
Class Method Summary collapse
-
.binary_to_string(value) ⇒ Object
Used to convert from BLOBs to Strings.
Instance Method Summary collapse
-
#type_cast(value) ⇒ Object
Casts value (which is a String) to an appropriate instance.
Class Method Details
.binary_to_string(value) ⇒ Object
Used to convert from BLOBs to Strings
206 207 208 209 |
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 206 def self.binary_to_string(value) # Returns a string removing the eventual BLOB scalar function value.to_s.gsub(/"SYSIBM"."BLOB"\('(.*)'\)/i,'\1') end |
Instance Method Details
#type_cast(value) ⇒ Object
Casts value (which is a String) to an appropriate instance
198 199 200 201 202 203 |
# File 'lib/active_record/connection_adapters/ibm_db_adapter.rb', line 198 def type_cast(value) # Casts the database NULL value to nil return nil if value == 'NULL' # Invokes parent's method for default casts super end |