Sha256: 0b2f1984be3420778773f5c0953e94e80b03489163b5737da5838ddf8a0b2c86

Contents?: true

Size: 561 Bytes

Versions: 38

Compression:

Stored size: 561 Bytes

Contents

# frozen_string_literal: true

module ActiveRecord
  module ConnectionAdapters
    module SQLServer
      module Type
        class SmallDateTime < DateTime
          def type
            :smalldatetime
          end

          def sqlserver_type
            "smalldatetime"
          end

          private

          def fast_string_to_time_format
            ::Time::DATE_FORMATS[:_sqlserver_datetime]
          end

          def apply_seconds_precision(value)
            value.change usec: 0 if value
          end
        end
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
activerecord-sqlserver-adapter-7.0.5.0 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-7.0.4.0 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-7.0.3.0 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-6.0.3 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-7.0.2.0 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-6.1.3.0 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-7.0.1.0 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-7.0.0.0 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-7.0.0.0.rc1 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-6.1.2.1 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-6.1.2.0 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-6.1.1.0 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-6.1.0.0 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-6.1.0.0.rc1 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-6.0.2 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-6.0.1 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-6.0.0 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb
activerecord-sqlserver-adapter-6.0.0.rc2 lib/active_record/connection_adapters/sqlserver/type/smalldatetime.rb