Skip to content

Commit

Permalink
Throw an error if the user forgot to add DatabaseCleaner to the Gemfi…
Browse files Browse the repository at this point in the history
…le, allowing them to decide whether or not to use it. Closes cucumber#36.
  • Loading branch information
aslakhellesoy committed Mar 22, 2011
1 parent 9c6c8ea commit 7dd45ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 5 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
== In Git

=== Bugfixes
* Throw an error if the user forgot to add DatabaseCleaner to the Gemfile, allowing them to decide whether or not to use it. (#36 Aslak Hellesøy, Ryan Bigg)

== 0.4.0 2011-03-20

=== New Features
Expand Down
8 changes: 6 additions & 2 deletions templates/install/support/_rails_each_run.rb.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
#
ActionController::Base.allow_rescue = false

# Remove this line if your app doesn't have a database.
# Remove/comment out the lines below if your app doesn't have a database.
# For some databases (like MongoDB and CouchDB) you may need to use :truncation instead.
DatabaseCleaner.strategy = :transaction
begin
DatabaseCleaner.strategy = :transaction
rescue NameError
raise "You need to add database_cleaner to your Gemfile if you wish to use it."
end

0 comments on commit 7dd45ac

Please sign in to comment.