Sha256: ef2984969951ca56dec3e80ffb14d36b7b7467eaf9830a6959767d2ad54f9cdb

Contents?: true

Size: 536 Bytes

Versions: 35

Compression:

Stored size: 536 Bytes

Contents

# frozen_string_literal: true

module ActiveRecord
  module ConnectionAdapters
    module SQLServer
      module Type
        class DecimalWithoutScale < ActiveRecord::Type::DecimalWithoutScale
          def sqlserver_type
            "decimal".yield_self do |type|
              type += "(#{precision.to_i},0)" if precision
              type
            end
          end

          def type_cast_for_schema(value)
            value.is_a?(BigDecimal) ? value.to_s : value.inspect
          end
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
activerecord-sqlserver-adapter-8.0.0 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.2.2 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.9 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.8 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.2.1 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.2.0 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.7 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.6 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.5 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.4 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.0.7 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.3 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.2 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.1 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.0 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.0.6 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.0.rc2 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.0.rc1 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.0.5.1 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb
activerecord-sqlserver-adapter-7.1.0.beta1 lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb