From 30bf07d172f2764b27e887ff3a122ce3c08ff5fe Mon Sep 17 00:00:00 2001 From: Sean Griffin Date: Wed, 21 May 2014 07:44:42 -0700 Subject: Move PG OID types to their own files As we promote these classes to first class concepts, these classes are starting to gain enough behavior to warrant being moved into their own files. Many of them will become quite large as we move additional behavior to the type objects. --- .../connection_adapters/postgresql/oid/decimal.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb') diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb b/activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb new file mode 100644 index 0000000000..ed4b8911d9 --- /dev/null +++ b/activerecord/lib/active_record/connection_adapters/postgresql/oid/decimal.rb @@ -0,0 +1,13 @@ +module ActiveRecord + module ConnectionAdapters + module PostgreSQL + module OID # :nodoc: + class Decimal < Type::Decimal + def infinity(options = {}) + BigDecimal.new("Infinity") * (options[:negative] ? -1 : 1) + end + end + end + end + end +end -- cgit v1.2.3