bmabey/database_cleaner — Issue #105: Rails3.2, DatabaseCleaner.strategy = :truncation, ignoring :except and deleting all tables
Author: thimmaiah
Created: 2012-03-04 12:03:12+00:00
State: open

This is a prob encountered when migrating to rails 3.2.1 - No issues in prev versions

In my env.rb file I have

DatabaseCleaner.strategy = :truncation ,
{:except => %w[user_roles locations category_custom_fields industry_classifications]}

However all tables get truncated at the end of the test case

1. I put some debug statements inside "generic/truncation.rb" to print @tables_to_exclude.
2. At the start of the testcase I see the output (which is correct based on configs above)
@tables_to_exclude = ["user_roles", "locations", "category_custom_fields", "industry_classifications", "schema_migrations"]
3. At the end of the test case before the truncation is done I see the output (which is incorrect based on configs above)
@tables_to_exclude = ["schema_migrations"]

So somewhere the @tables_to_exclude. is getting overwritten ?

Please help with this as my test cases simply wont run without the static tables required

##########################
My Gemfile.lock for ref is here
##########################

GIT
remote: git://github.com/MeetDom/exception_logger.git
revision: 912f6302c0217414401ab5ee4a44242f183581a1
specs:
exception_logger (0.1.10)

GEM
remote: https://rubygems.org/
specs:
actionmailer (3.2.1)
actionpack (= 3.2.1)
mail (~> 2.4.0)
actionpack (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.1)
rack-test (~> 0.6.1)
sprockets (~> 2.1.2)
active_utils (1.0.3)
activesupport (>= 2.3.11)
i18n
activemerchant (1.20.4)
active_utils (>= 1.0.2)
activesupport (>= 2.3.11)
braintree (>= 2.0.0)
builder (>= 2.0.0)
i18n
json (>= 1.5.1)
money (<= 3.7.1)
activemodel (3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
activerecord (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
arel (~> 3.0.0)
tzinfo (~> 0.3.29)
activeresource (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
activesupport (3.2.1)
i18n (~> 0.6)
multi_json (~> 1.0)
acts-as-taggable-on (2.2.2)
rails (~> 3.0)
acts_as_list-rails3 (0.0.4)
addressable (2.2.7)
akami (1.0.0)
gyoku (>= 0.4.0)
arel (3.0.2)
aws-s3 (0.6.2)
builder
mime-types
xml-simple
aws-sdk (1.3.5)
httparty (~> 0.7)
json (~> 1.4)
nokogiri (>= 1.4.4)
uuidtools (~> 2.1)
aws-ses (0.4.4)
builder
mail (> 2.2.5)
mime-types
xml-simple
babosa (0.3.6)
bcrypt-ruby (3.0.1)
braintree (2.13.4)
builder (>= 2.0.0)
builder (3.0.0)
cancan (1.6.7)
capistrano (2.11.2)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
capybara (1.1.2)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
selenium-webdriver (~> 2.0)
xpath (~> 0.1.4)
childprocess (0.3.1)
ffi (~> 1.0.6)
chronic (0.6.7)
chunky_png (1.2.5)
cocaine (0.2.1)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.2.0)
compass (0.12.rc.1)
chunky_png (~> 1.2)
fssm (>= 0.2.7)
sass (~> 3.1)
compass-rails (1.0.0.rc.3)
compass (~> 0.12.rc.0)
cucumber (1.1.9)
builder (>= 2.1.2)
diff-lcs (>= 1.1.2)
gherkin (~> 2.9.0)
json (>= 1.4.6)
term-ansicolor (>= 1.0.6)
cucumber-rails (1.3.0)
capybara (>= 1.1.2)
cucumber (>= 1.1.8)
nokogiri (>= 1.5.0)
daemons (1.0.10)
database_cleaner (0.7.1)
delayed_job (2.1.4)
activesupport (~> 3.0)
daemons
devise (2.0.4)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
railties (~> 3.1)
warden (~> 1.1.1)
diff-lcs (1.1.3)
domain_name (0.5.2)
unf (~> 0.0.3)
email_spec (1.2.1)
mail (~> 2.2)
rspec (~> 2.0)
erubis (2.7.0)
escape_utils (0.2.4)
eventmachine (0.12.10)
exception_notification (2.5.2)
actionmailer (>= 3.0.4)
execjs (1.3.0)
multi_json (~> 1.0)
faker (1.0.1)
i18n (~> 0.4)
fancy-buttons (1.1.2)
compass (>= 0.11)
ffi (1.0.11)
friendly_id (3.3.2.0)
babosa (~> 0.3.0)
fssm (0.2.8.1)
geokit (1.6.5)
multi_json
geokit-rails3 (0.1.5)
geokit (~> 1.5)
rails (~> 3.0)
gherkin (2.9.0)
json (>= 1.4.6)
google_places (0.0.8)
httparty
gyoku (0.4.4)
builder (>= 2.1.2)
haml (3.1.4)
haml-rails (0.3.4)
actionpack (~> 3.0)
activesupport (~> 3.0)
haml (~> 3.0)
railties (~> 3.0)
hashie (1.2.0)
high_voltage (1.1.1)
highline (1.6.11)
hike (1.2.1)
httparty (0.8.1)
multi_json
multi_xml
httpi (0.9.6)
rack
i18n (0.6.0)
journey (1.0.3)
jquery-rails (2.0.1)
railties (>= 3.2.0, < 5.0)
thor (~> 0.14)
json (1.6.5)
jwt (0.1.4)
json (>= 1.2.4)
kaminari (0.13.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
launchy (2.0.5)
addressable (~> 2.2.6)
libv8 (3.3.10.4)
mail (2.4.1)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mechanize (2.3)
domain_name (~> 0.5, >= 0.5.1)
mime-types (~> 1.17, >= 1.17.2)
net-http-digest_auth (~> 1.1, >= 1.1.1)
net-http-persistent (~> 2.5, >= 2.5.2)
nokogiri (~> 1.4)
ntlm-http (~> 0.1, >= 0.1.1)
webrobots (~> 0.0, >= 0.0.9)
memcache-client (1.8.5)
metamagic (1.0.0)
mime-types (1.17.2)
money (3.7.1)
i18n (~> 0.4)
multi_json (1.1.0)
multi_xml (0.4.1)
mysql2 (0.3.11)
net-http-digest_auth (1.2)
net-http-persistent (2.5.2)
net-scp (1.0.4)
net-ssh (>= 1.99.1)
net-sftp (2.0.5)
net-ssh (>= 2.0.9)
net-ssh (2.3.0)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
nokogiri (1.5.0)
nori (1.1.0)
ntlm-http (0.1.1)
omniauth (1.0.2)
hashie (~> 1.2)
rack
orm_adapter (0.0.6)
paperclip (2.7.0)
activerecord (>= 2.3.0)
activesupport (>= 2.3.2)
cocaine (>= 0.0.2)
mime-types
polyamorous (0.5.0)
activerecord (~> 3.0)
polyglot (0.3.3)
postmark (0.9.10)
postmark-rails (0.4.1)
actionmailer
postmark (>= 0.9.0)
rake
rack (1.4.1)
rack-cache (1.1)
rack (>= 0.4)
rack-rewrite (1.2.1)
rack-ssl (1.3.2)
rack
rack-ssl-enforcer (0.2.4)
rack-test (0.6.1)
rack (>= 1.0)
rails (3.2.1)
actionmailer (= 3.2.1)
actionpack (= 3.2.1)
activerecord (= 3.2.1)
activeresource (= 3.2.1)
activesupport (= 3.2.1)
bundler (~> 1.0)
railties (= 3.2.1)
rails3-generators (0.17.4)
railties (>= 3.0.0)
railties (3.2.1)
actionpack (= 3.2.1)
activesupport (= 3.2.1)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.12)
json (~> 1.4)
recaptcha (0.3.4)
rest-client (1.6.7)
mime-types (>= 1.16)
riddle (1.5.1)
rspec (2.8.0)
rspec-core (~> 2.8.0)
rspec-expectations (~> 2.8.0)
rspec-mocks (~> 2.8.0)
rspec-core (2.8.0)
rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.8.0)
rubyzip (0.9.6.1)
sass (3.1.15)
sass-rails (3.2.4)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
savon (0.9.9)
akami (~> 1.0)
builder (>= 2.1.2)
gyoku (>= 0.4.0)
httpi (~> 0.9)
nokogiri (>= 1.4.0)
nori (~> 1.1)
wasabi (~> 2.1)
selenium-webdriver (2.20.0)
childprocess (>= 0.2.5)
ffi (~> 1.0)
multi_json (~> 1.0)
rubyzip
spork (0.9.0)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
squeel (0.9.5)
activerecord (~> 3.0)
activesupport (~> 3.0)
polyamorous (~> 0.5.0)
term-ansicolor (1.0.7)
therubyracer (0.9.10)
libv8 (~> 3.3.10)
thin (1.3.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
rack (>= 1.0.0)
thinking-sphinx (2.0.11)
activerecord (>= 3.0.3)
builder (>= 2.1.2)
riddle (>= 1.5.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
twilio-ruby (3.4.0)
builder (>= 2.1.2)
jwt (>= 0.1.2)
multi_json (>= 1.0.3)
tzinfo (0.3.31)
uglifier (1.2.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
unf (0.0.5)
unf_ext
unf_ext (0.0.4)
uuidtools (2.1.2)
warden (1.1.1)
rack (>= 1.0)
wasabi (2.1.0)
nokogiri (>= 1.4.0)
webrobots (0.0.13)
whenever (0.7.3)
activesupport (>= 2.3.4)
chronic (~> 0.6.3)
will_paginate (3.0.3)
workflow (0.8.1)
xml-simple (1.1.1)
xpath (0.1.4)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
activemerchant
acts-as-taggable-on
acts_as_list-rails3
aws-s3
aws-sdk
aws-ses
bcrypt-ruby (~> 3.0.0)
cancan
capistrano
capybara
coffee-rails (~> 3.2.1)
compass
compass-rails
cucumber
cucumber-rails
daemons (= 1.0.10)
database_cleaner
delayed_job (= 2.1.4)
devise
email_spec
escape_utils
exception_logger!
exception_notification
faker
fancy-buttons
friendly_id (= 3.3.2)
geokit
geokit-rails3
google_places
haml
haml-rails
high_voltage
jquery-rails
kaminari
launchy
mechanize
memcache-client
metamagic
mysql2
nokogiri
omniauth
paperclip
postmark
postmark-rails
rack-rewrite
rack-ssl-enforcer
rails (= 3.2.1)
rails3-generators
recaptcha
rest-client
riddle
sass-rails (~> 3.2.3)
savon
selenium-webdriver
spork (~> 0.9.0.rc)
sprockets
squeel
therubyracer
thin
thinking-sphinx
twilio-ruby (= 3.4.0)
uglifier (>= 1.0.3)
whenever
will_paginate
workflow