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
8 9 10 11 12 13 |
# File 'lib/active_record/connection_adapters/sqlserver/type/decimal.rb', line 8 def sqlserver_type "decimal".yield_self do |type| type += "(#{precision.to_i},#{scale.to_i})" if precision || scale type end end |
#type_cast_for_schema(value) ⇒ Object
15 16 17 |
# File 'lib/active_record/connection_adapters/sqlserver/type/decimal.rb', line 15 def type_cast_for_schema(value) value.is_a?(BigDecimal) ? value.to_s : value.inspect end |