aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorzverok <zverok.offline@gmail.com>2017-08-11 12:41:18 +0300
committerzverok <zverok.offline@gmail.com>2017-08-11 12:41:18 +0300
commite47fbba7d7ad7647840836ebd709e4169230d35a (patch)
tree164e5f7fe9419df007e1adc57fd2bf8fadad2db3 /activerecord/lib/active_record
parent98298092093d733bed2a874e3d2c455fe45386a3 (diff)
downloadrails-e47fbba7d7ad7647840836ebd709e4169230d35a.tar.gz
rails-e47fbba7d7ad7647840836ebd709e4169230d35a.tar.bz2
rails-e47fbba7d7ad7647840836ebd709e4169230d35a.zip
Update database duplication check
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/tasks/postgresql_database_tasks.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb b/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb
index a2e74efc2b..955b1d4e94 100644
--- a/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb
+++ b/activerecord/lib/active_record/tasks/postgresql_database_tasks.rb
@@ -22,7 +22,7 @@ module ActiveRecord
configuration.merge("encoding" => encoding)
establish_connection configuration
rescue ActiveRecord::StatementInvalid => error
- if /database .* already exists/.match?(error.message)
+ if error.cause.is_a?(PG::DuplicateDatabase)
raise DatabaseAlreadyExists
else
raise