Sha256: 3068b632b71e06161fb2a7d9a788ee256d9e498d5166bea226f4ddf64c79b5f7

Contents?: true

Size: 1.13 KB

Versions: 17

Compression:

Stored size: 1.13 KB

Contents

module ActiveRecord
  module ConnectionAdapters
    module OracleEnhanced
      module JDBCQuoting
        def _type_cast(value)
          case value
          when ActiveModel::Type::Binary::Data
            blob = Java::OracleSql::BLOB.createTemporary(@connection.raw_connection, false, Java::OracleSql::BLOB::DURATION_SESSION)
            blob.setBytes(1, value.to_s.to_java_bytes)
            blob
          when ActiveRecord::OracleEnhanced::Type::Text::Data
            clob = Java::OracleSql::CLOB.createTemporary(@connection.raw_connection, false, Java::OracleSql::CLOB::DURATION_SESSION)
            clob.setString(1, value.to_s)
            clob
          when Date, DateTime
            Java::oracle.sql.DATE.new(value.strftime("%Y-%m-%d %H:%M:%S"))
          when Time
            Java::java.sql.Timestamp.new(value.year-1900, value.month-1, value.day, value.hour, value.min, value.sec, value.usec * 1000)
          else
            super
          end
        end
      end
    end
  end
end

module ActiveRecord
  module ConnectionAdapters
    module OracleEnhanced
      module Quoting
        prepend JDBCQuoting
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
activerecord-oracle_enhanced-adapter-1.7.9 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.8 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.7 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.6 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.5 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.4 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.3 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.2 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.1 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.0 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.0.rc1 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta7 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta6 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta5 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta4 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta3 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-1.7.0.beta2 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb