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

pull/1188/head
Philipp Tessenow 12 years ago
parent 647ad0c5da
commit d8785a3f86
  1. 7
      test/test_helper.rb

@ -62,6 +62,13 @@ 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 ActiveRecord::Base.connection.is_a?(ActiveRecord::ConnectionAdapters::PostgreSQLAdapter)
ActiveRecord::Base.connection.reset_pk_sequence!(model.table_name)
end
end
end
def log_user(login, password)

Loading…
Cancel
Save