Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Put the create_table block in a transaction.

This will solve the issue that abort the connection transaction when we
skip the tests.
  • Loading branch information...
commit 4fa2f10494260c0937ffe066aace09747e57d7c7 1 parent a690935
@rafaelfranca rafaelfranca authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 activerecord/test/cases/adapters/postgresql/json_test.rb
View
6 activerecord/test/cases/adapters/postgresql/json_test.rb
@@ -12,8 +12,10 @@ class JsonDataType < ActiveRecord::Base
def setup
@connection = ActiveRecord::Base.connection
begin
- @connection.create_table('json_data_type') do |t|
- t.json 'payload', :default => {}
+ @connection.transaction do
+ @connection.create_table('json_data_type') do |t|
+ t.json 'payload', :default => {}
+ end
end
rescue ActiveRecord::StatementInvalid
return skip "do not test on PG without json"

1 comment on commit 4fa2f10

Please sign in to comment.
Something went wrong with that request. Please try again.