Class: ActiveRecord::ConnectionAdapters::SQLServer::Type::Decimal
- Inherits:
-
Type::Decimal
- Object
- Type::Decimal
- ActiveRecord::ConnectionAdapters::SQLServer::Type::Decimal
- Defined in:
- lib/active_record/connection_adapters/sqlserver/type/decimal.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#sqlserver_type ⇒ Object
7 8 9 10 11 |
# File 'lib/active_record/connection_adapters/sqlserver/type/decimal.rb', line 7 def sqlserver_type 'decimal'.tap do |type| type << "(#{precision.to_i},#{scale.to_i})" if precision || scale end end |
#type_cast_for_schema(value) ⇒ Object
13 14 15 |
# File 'lib/active_record/connection_adapters/sqlserver/type/decimal.rb', line 13 def type_cast_for_schema(value) value.is_a?(BigDecimal) ? value.to_s : value.inspect end |