diff options
author | Abdelkader Boudih <terminale@gmail.com> | 2014-06-28 15:08:13 +0000 |
---|---|---|
committer | Abdelkader Boudih <terminale@gmail.com> | 2014-06-28 15:16:28 +0000 |
commit | 35591d3a8946b7438aa2a3de2d360943451943ef (patch) | |
tree | 065614768039705f4779e5adb4a185f3b3fa15ac /activerecord/test | |
parent | cad584e683e266d9f05c3b9c2a0240fc44b72cbf (diff) | |
download | rails-35591d3a8946b7438aa2a3de2d360943451943ef.tar.gz rails-35591d3a8946b7438aa2a3de2d360943451943ef.tar.bz2 rails-35591d3a8946b7438aa2a3de2d360943451943ef.zip |
[Postgresql tests] remove duplicate helper
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/adapters/postgresql/uuid_test.rb | 15 |
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| |