Sha256: c2f0f0a3d6d70624bf596fa61f64cc6463603032c43884e83d332fb5fbc6586a

Contents?: true

Size: 1.14 KB

Versions: 22

Compression:

Stored size: 1.14 KB

Contents

module ActiveRecord
  module ConnectionAdapters
    module Sqlserver
      module CoreExt
        module ActiveRecord
          
          extend ActiveSupport::Concern
          
          included do
            class_attribute :coerced_sqlserver_date_columns, :coerced_sqlserver_time_columns
            self.coerced_sqlserver_date_columns = Set.new
            self.coerced_sqlserver_time_columns = Set.new
          end

          module ClassMethods
            
            def execute_procedure(proc_name, *variables)
              if connection.respond_to?(:execute_procedure)
                connection.execute_procedure(proc_name,*variables)
              else
                []
              end
            end

            def coerce_sqlserver_date(*attributes)
              self.coerced_sqlserver_date_columns += attributes.map(&:to_s)
            end

            def coerce_sqlserver_time(*attributes)
              self.coerced_sqlserver_time_columns += attributes.map(&:to_s)
            end

          end

        end
      end
    end
  end
end


ActiveRecord::Base.send :include, ActiveRecord::ConnectionAdapters::Sqlserver::CoreExt::ActiveRecord

Version data entries

22 entries across 22 versions & 2 rubygems

Version Path
activerecord-sqlserver-adapter-3.2.0.rc2 lib/active_record/connection_adapters/sqlserver/core_ext/active_record.rb
activerecord-sqlserver-adapter-3.2.0.rc1 lib/active_record/connection_adapters/sqlserver/core_ext/active_record.rb