lib/mongrel2/config/host.rb in mongrel2-0.15.0 vs lib/mongrel2/config/host.rb in mongrel2-0.15.1
- old
+ new
@@ -14,9 +14,16 @@
# matching TEXT);
one_to_many :routes
many_to_one :server
+
+ ### Clean up the host's routes when it's destroyed.
+ def before_destroy
+ self.routes.each( &:destroy )
+ end
+
+
### DSL methods for the Server context besides those automatically-generated from its
### columns.
module DSLMethods
### Add a Mongrel2::Config::Route to the Host object.