aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-08-25 11:58:12 +0200
committerYves Senn <yves.senn@gmail.com>2014-08-25 12:01:10 +0200
commit3fe54b3a058509a52bc55bbf1c8bbc308c596891 (patch)
treefc1935833ef48bab9b09fc979e8ce9c05c11f634 /activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
parent5cdd02ddd4c09480ce22a8d338daa0722e75b7d3 (diff)
downloadrails-3fe54b3a058509a52bc55bbf1c8bbc308c596891.tar.gz
rails-3fe54b3a058509a52bc55bbf1c8bbc308c596891.tar.bz2
rails-3fe54b3a058509a52bc55bbf1c8bbc308c596891.zip
pg, `default_sequence_name` needs to return a string.
This is a reacon to https://github.com/rails/rails/commit/d6c1205584b1ba597db4071b168681678b1e9875#commitcomment-7502487 This backwards incompatibility was introduced with d6c12055 to fix #7516. However both `connection.default_sequence_name` and `model.sequence_name` are public API. The PostgreSQL adapter should honor the interface and return strings. /cc @matthewd @chancancode
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb4
1 files changed, 2 insertions, 2 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 323da7b717..767b6b614a 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
@@ -281,9 +281,9 @@ module ActiveRecord
def default_sequence_name(table_name, pk = nil) #:nodoc:
result = serial_sequence(table_name, pk || 'id')
return nil unless result
- Utils.extract_schema_qualified_name(result)
+ Utils.extract_schema_qualified_name(result).to_s
rescue ActiveRecord::StatementInvalid
- PostgreSQL::Name.new(nil, "#{table_name}_#{pk || 'id'}_seq")
+ PostgreSQL::Name.new(nil, "#{table_name}_#{pk || 'id'}_seq").to_s
end
def serial_sequence(table, column)