diff options
author | zverok <zverok.offline@gmail.com> | 2017-08-11 12:41:18 +0300 |
---|---|---|
committer | zverok <zverok.offline@gmail.com> | 2017-08-11 12:41:18 +0300 |
commit | e47fbba7d7ad7647840836ebd709e4169230d35a (patch) | |
tree | 164e5f7fe9419df007e1adc57fd2bf8fadad2db3 /activerecord/lib/active_record | |
parent | 98298092093d733bed2a874e3d2c455fe45386a3 (diff) | |
download | rails-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.rb | 2 |
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 |