From 7d993febee4d14fe03a770a9c850ff973316171f Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 23 Sep 2013 11:41:35 +0100 Subject: [PATCH] Avoid "unknown OID" warnings from Postgres driver --- config/initializers/postgresql_adapter.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config/initializers/postgresql_adapter.rb b/config/initializers/postgresql_adapter.rb index 825feba8b..ff1f7f87a 100644 --- a/config/initializers/postgresql_adapter.rb +++ b/config/initializers/postgresql_adapter.rb @@ -58,6 +58,20 @@ if defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) rescue nil end + + def initialize_type_map_with_enums + OID.alias_type "format_enum", "text" + OID.alias_type "gpx_visibility_enum", "text" + OID.alias_type "note_status_enum", "text" + OID.alias_type "note_event_enum", "text" + OID.alias_type "nwr_enum", "text" + OID.alias_type "user_role_enum", "text" + OID.alias_type "user_status_enum", "text" + + initialize_type_map_without_enums + end + + alias_method_chain :initialize_type_map, :enums end class PostgreSQLColumn -- 2.39.5