aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/uuid_test.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-06-28 19:27:14 +0200
committerYves Senn <yves.senn@gmail.com>2014-06-28 19:27:14 +0200
commitb44174f8c8f3b9b8040955f981d30e64558f0044 (patch)
tree6a768b708258bb3a4f4adc48999ffdffc4500bb3 /activerecord/test/cases/adapters/postgresql/uuid_test.rb
parent13770587ef7f909e53a000bfae790f92576a3d93 (diff)
parent35591d3a8946b7438aa2a3de2d360943451943ef (diff)
downloadrails-b44174f8c8f3b9b8040955f981d30e64558f0044.tar.gz
rails-b44174f8c8f3b9b8040955f981d30e64558f0044.tar.bz2
rails-b44174f8c8f3b9b8040955f981d30e64558f0044.zip
Merge pull request #15957 from seuros/duplicate
[Postgresql tests] remove duplicate helper
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql/uuid_test.rb')
-rw-r--r--activerecord/test/cases/adapters/postgresql/uuid_test.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/uuid_test.rb b/activerecord/test/cases/adapters/postgresql/uuid_test.rb
index 40ed0f64a4..8b27570a36 100644
--- a/activerecord/test/cases/adapters/postgresql/uuid_test.rb
+++ b/activerecord/test/cases/adapters/postgresql/uuid_test.rb
@@ -9,15 +9,6 @@ module PostgresqlUUIDHelper
@connection ||= ActiveRecord::Base.connection
end
- def enable_uuid_ossp
- unless connection.extension_enabled?('uuid-ossp')
- connection.enable_extension 'uuid-ossp'
- connection.commit_db_transaction
- end
-
- connection.reconnect!
- end
-
def drop_table(name)
connection.execute "drop table if exists #{name}"
end
@@ -91,7 +82,7 @@ class PostgresqlUUIDGenerationTest < ActiveRecord::TestCase
end
setup do
- enable_uuid_ossp
+ enable_uuid_ossp!(connection)
connection.create_table('pg_uuids', id: :uuid, default: 'uuid_generate_v1()') do |t|
t.string 'name'
@@ -139,7 +130,7 @@ class PostgresqlUUIDTestNilDefault < ActiveRecord::TestCase
include PostgresqlUUIDHelper
setup do
- enable_uuid_ossp
+ enable_uuid_ossp!(connection)
connection.create_table('pg_uuids', id: false) do |t|
t.primary_key :id, :uuid, default: nil
@@ -176,7 +167,7 @@ class PostgresqlUUIDTestInverseOf < ActiveRecord::TestCase
end
setup do
- enable_uuid_ossp
+ enable_uuid_ossp!(connection)
connection.transaction do
connection.create_table('pg_uuid_posts', id: :uuid) do |t|