Class: ActiveRecord::ConnectionAdapters::SQLServer::Type::DecimalWithoutScale

Inherits:
Type::DecimalWithoutScale
  • Object
show all
Defined in:
lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb

Instance Method Summary collapse

Instance Method Details

#sqlserver_typeObject



8
9
10
11
12
13
# File 'lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb', line 8

def sqlserver_type
  "decimal".yield_self do |type|
    type += "(#{precision.to_i},0)" if precision
    type
  end
end

#type_cast_for_schema(value) ⇒ Object



15
16
17
# File 'lib/active_record/connection_adapters/sqlserver/type/decimal_without_scale.rb', line 15

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