aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-03-16 16:19:48 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-03-22 16:22:01 -0700
commit072dbbf2aeb2be4f074ba8e404ee157f281bedf9 (patch)
tree85e171754257b610a62fd0aecf973cfeb003ebb9 /activerecord/lib
parent6b7fdf3bf3675a14eae74acc5241089308153a34 (diff)
downloadrails-072dbbf2aeb2be4f074ba8e404ee157f281bedf9.tar.gz
rails-072dbbf2aeb2be4f074ba8e404ee157f281bedf9.tar.bz2
rails-072dbbf2aeb2be4f074ba8e404ee157f281bedf9.zip
pull add_column_options! off the pg connection class
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb13
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb13
2 files changed, 13 insertions, 13 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
index 766b5f07b1..28c5209ad4 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
@@ -15,6 +15,19 @@ module ActiveRecord
sql
end
+
+ def add_column_options!(sql, options)
+ if options[:array] || options[:column].try(:array)
+ sql << '[]'
+ end
+
+ column = options.fetch(:column) { return super }
+ if column.type == :uuid && options[:default] =~ /\(\)/
+ sql << " DEFAULT #{options[:default]}"
+ else
+ super
+ end
+ end
end
def schema_creation
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 2a19f4ab0b..0a903d8aad 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -627,19 +627,6 @@ module ActiveRecord
@table_alias_length ||= query('SHOW max_identifier_length', 'SCHEMA')[0][0].to_i
end
- def add_column_options!(sql, options)
- if options[:array] || options[:column].try(:array)
- sql << '[]'
- end
-
- column = options.fetch(:column) { return super }
- if column.type == :uuid && options[:default] =~ /\(\)/
- sql << " DEFAULT #{options[:default]}"
- else
- super
- end
- end
-
# Set the authorized user for this session
def session_auth=(user)
clear_cache!