From 269b96d76e91b6e0d793d812a60f988c3b49ca25 Mon Sep 17 00:00:00 2001 From: Usuario de Programacion Date: Wed, 18 Feb 2009 17:32:01 +0100 Subject: [PATCH] Changed the returned simplified type when DB type is XML. This way the schema is correctly dumped to schema.rb --- .../connection_adapters/postgresql_adapter.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 913bb52..ce7d291 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -99,7 +99,7 @@ module ActiveRecord :string # XML type when /^xml$/ - :string + :xml # Arrays when /^\D+\[\]$/ :string -- 1.5.4.3 From 9aaa72e09465be2ccd996a6da8f957ec21027060 Mon Sep 17 00:00:00 2001 From: Usuario de Programacion Date: Wed, 18 Feb 2009 17:45:39 +0100 Subject: [PATCH] Added short hand column definition for migrations --- .../connection_adapters/postgresql_adapter.rb | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index ce7d291..2285c02 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -39,6 +39,12 @@ module ActiveRecord end module ConnectionAdapters + class TableDefinition + def xml(*args) + options = args.extract_options! + column(args[0], :xml, options) + end + end # PostgreSQL-specific extensions to column definitions in a table. class PostgreSQLColumn < Column #:nodoc: # Instantiates a new PostgreSQL column definition in a table. -- 1.5.4.3