<commit_before>require 'database_cleaner/sequel/base'
module DatabaseCleaner
  module Sequel
    class Transaction
      include ::DatabaseCleaner::Sequel::Base

      def start
        @transactions ||= []
        db.send(:add_transaction)
        @transactions << db.send(:begin_transaction, db)
      end
  
      def clean
        transaction = @transactions.pop
        db.send(:rollback_transaction, transaction)
        db.send(:remove_transaction, transaction)
      end
    end
  end
end
<commit_msg>Fixed Sequel::Transaction so that it works with latest Sequel. Previously it would crash.<commit_after>require 'database_cleaner/sequel/base'
module DatabaseCleaner
  module Sequel
    class Transaction
      include ::DatabaseCleaner::Sequel::Base

      def start
        @transactions ||= []
        opts= {:savepoint => true}
        db.send(:add_transaction, db, opts)
        db.send(:begin_transaction, db, opts)
        @transactions << db
      end

      def clean
        db= @transactions.pop
        db.send(:rollback_transaction, db)
        db.send(:remove_transaction, db, false)
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.09002647837599294, 'fraction_numerical': 0.0, 'mean_word_length': 2.6938110749185666, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4812187', 'n_tokens_mistral': 320, 'n_tokens_neox': 314, 'n_words': 80}