Revert "ugly hack to reset pk_sequences on the ci. postgres got stuck after importing fixtures.."

This hack was causing most tests to fail on Postgres with:

    ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR:  current transaction is aborted, commands ignored until end of transaction block

This reverts commit d8785a3f86.

Signed-off-by: Alex Coles <alex@alexbcoles.com>
pull/2168/head
Alex Coles 10 years ago
parent 8f34831777
commit fa06867d47
  1. 9
      test/test_helper.rb

@ -83,15 +83,6 @@ class ActiveSupport::TestCase
def setup
super
Rails.cache.clear
# Ugly H4X to convince postgresql to update its sequences after bulk loading fixtures
# TODO: remove this when we got rid of the fixtures
ActiveRecord::Base.descendants.each do |model|
if model.table_name \
and defined?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter) \
and ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
ActiveRecord::Base.connection.reset_pk_sequence!(model.table_name)
end
end
# initializes the mocking features
RSpec::Mocks.setup

Loading…
Cancel
Save