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

Inherits:
Type::Decimal show all
Defined in:
lib/active_record/connection_adapters/postgresql/oid/decimal.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from Type::Value

#limit, #precision, #scale

Instance Method Summary collapse

Methods inherited from Type::Decimal

#type, #type_cast_for_schema

Methods included from Type::Numeric

#changed?, #number?, #type_cast

Methods inherited from Type::Value

#==, #binary?, #changed?, #changed_in_place?, #hash, #initialize, #klass, #number?, #text?, #type, #type_cast_for_database, #type_cast_for_schema, #type_cast_from_database, #type_cast_from_user

Constructor Details

This class inherits a constructor from ActiveRecord::Type::Value

Instance Method Details

#infinity(options = {}) ⇒ Object



6
7
8
# File 'lib/active_record/connection_adapters/postgresql/oid/decimal.rb', line 6

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