title: How to use DatabaseCleaner[:active_record].strategy = :transaction with selenium
body: <p>I have written cucumber test cases and now i need to rollback database not the existing one. I have use selenium web-driver with capybara 2.0.2. When i have tried with:</p>
  
  <pre><code>DatabaseCleaner[:active_record].strategy = :truncation
  </code></pre>
  
  <p>It is deleted all records of my mysql table. Afterwards i have changed this is by:</p>
  
  <pre><code> DatabaseCleaner[:active_record].strategy = :transaction
  </code></pre>
  
  <p>But this is not rolling database.</p>
  
  <p>My database.rb is:</p>
  
  <pre><code>require 'active_record'
  require 'database_cleaner'
  require 'database_cleaner/cucumber'
  
  ActiveRecord::Base.establish_connection(
      :adapter =&gt; 'mysql2',
      :database =&gt; 'aq_test',
      :username =&gt; 'root',
      :password =&gt; 'manager'  )
  
  class ActiveRecord::Base
      mattr_accessor :shared_connection
      @@shared_connection = nil
  
      def self.connection
          @@shared_connection || retrieve_connection
      end
  end
  ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
  DatabaseCleaner[:active_record].strategy = :transaction
  </code></pre>
  
  <p>But this is also not roll back the databases
  Note: I want only to rollback last transaction which is run by test cases</p>
  
  <p>Sorry for my english</p>