ActiveRecord::Base.destroy_all can really slow down tests. Plus, some feel it’s a bit hacky to set up your test’s preconditions by nuking all of the existing data.
- We have a test that validates all fixture data. Perhaps we’ll post it here.
Ask for Help
- “Why is ActionMailer’s multipart mailer causing a segmentation fault?” Though we don’t know, we do get a deprecation warning stating that the multipart mailer should not be used. So, stay away!
- “Say you have class Car extending class Automobile using Single Table Inheritance, does Automobile.destroy_all also destroy all Cars? If not, should it?” The answer is no, it does not and should not: the relationship between Automobile and Cars/Trucks is an inheritance, not a tree-like structure — Automobiles do not “own” Cars.