Sha256: bdfe358b202f4e1878488118456308c9323d5b84fc9fb2320462f1a5489d891a

Contents?: true

Size: 1.1 KB

Versions: 19

Compression:

Stored size: 1.1 KB

Contents

module ActiveRecord
  module ConnectionAdapters
    module SQLServerCoreExtensions
      module ODBC
        
        module TimeStamp
          def to_sqlserver_string
            date, time, nanoseconds = to_s.split(' ')
            "#{date} #{time}.#{sprintf("%03d",nanoseconds.to_i/1000000)}"
          end
        end
        
        module Statement
          def finished?
            begin
              connected?
              false
            rescue ::ODBC::Error => e
              true
            end
          end
        end

        module Database
          def run_block(*args)
            yield sth = run(*args)
            sth.drop
          end
        end
        
      end
    end
  end
end

ODBC::TimeStamp.send :include, ActiveRecord::ConnectionAdapters::SQLServerCoreExtensions::ODBC::TimeStamp if defined?(ODBC::TimeStamp)
ODBC::Statement.send :include, ActiveRecord::ConnectionAdapters::SQLServerCoreExtensions::ODBC::Statement if defined?(ODBC::Statement)
ODBC::Database.send :include, ActiveRecord::ConnectionAdapters::SQLServerCoreExtensions::ODBC::Database if defined?(ODBC::Database)

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
activerecord-sqlserver-adapter-2.3.24 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.23 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.22 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.21 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.20 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.19 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.18 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.17 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.16 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.15 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.13 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.12 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.11 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.10 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.9 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.8 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.7 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.6 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb
activerecord-sqlserver-adapter-2.3.5 lib/active_record/connection_adapters/sqlserver_adapter/core_ext/odbc.rb