aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 61694674ab..67570dad3c 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -104,7 +104,10 @@ module ActiveRecord
json: { name: "json" },
ltree: { name: "ltree" },
citext: { name: "citext" },
- point: { name: "point"}
+ point: { name: "point" },
+ bit: { name: "bit" },
+ bit_varying: { name: "bit varying" },
+ money: { name: "money" },
}
OID = PostgreSQL::OID #:nodoc:
@@ -433,8 +436,8 @@ module ActiveRecord
m.alias_type 'name', 'varchar'
m.alias_type 'bpchar', 'varchar'
m.register_type 'bool', Type::Boolean.new
- m.register_type 'bit', OID::Bit.new
- m.alias_type 'varbit', 'bit'
+ register_class_with_limit m, 'bit', OID::Bit
+ register_class_with_limit m, 'varbit', OID::BitVarying
m.alias_type 'timestamptz', 'timestamp'
m.register_type 'date', OID::Date.new
m.register_type 'time', OID::Time.new
@@ -558,6 +561,8 @@ module ActiveRecord
# JSON
when /\A'(.*)'::json\z/
$1
+ when /\A'(.*)'::money\z/
+ $1
# Object identifier types
when /\A-?\d+\z/
$1