Class: ActiveRecord::ConnectionAdapters::PostgreSQL::OID::Decimal

Inherits:
Type
  • Object
show all
Defined in:
lib/arjdbc/postgresql/base/oid.rb

Instance Method Summary collapse

Methods inherited from Type

#simplified_type

Instance Method Details

#infinity(options = {}) ⇒ Object



285
286
287
# File 'lib/arjdbc/postgresql/base/oid.rb', line 285

def infinity(options = {})
  BigDecimal.new("Infinity") * (options[:negative] ? -1 : 1)
end

#typeObject



277
# File 'lib/arjdbc/postgresql/base/oid.rb', line 277

def type; :decimal end

#type_cast(value) ⇒ Object



279
280
281
282
283
# File 'lib/arjdbc/postgresql/base/oid.rb', line 279

def type_cast(value)
  return if value.nil?

  ConnectionAdapters::Column.value_to_decimal value
end