@private
# File lib/arjdbc/oracle/column.rb, line 112 def guess_date_or_time(value) return value if value.is_a? Date ( value && value.hour == 0 && value.min == 0 && value.sec == 0 ) ? Date.new(value.year, value.month, value.day) : value end
@override
# File lib/arjdbc/oracle/column.rb, line 103 def string_to_time(string) return string unless string.is_a?(String) return nil if string.empty? return Time.now if string.index('CURRENT') == 0 # TODO seems very wrong super(string) end
Convert a value to a boolean.
# File lib/arjdbc/oracle/column.rb, line 90 def value_to_boolean(value) # NOTE: Oracle JDBC meta-data gets us DECIMAL for NUMBER(1) values # thus we're likely to get a column back as BigDecimal (e.g. 1.0) if value.is_a?(String) value.blank? ? nil : value == '1' elsif value.is_a?(Numeric) value.to_i == 1 # <BigDecimal:7b5bfe,'0.1E1',1(4)> else !! value end end
Generated with the Darkfish Rdoc Generator 2.