Renamed helpers to correspond to renamed Controller classes.
[merb_radiant.git] / radiant_extensions_plugins / plugins / scenarios / lib / scenarios / .svn / text-base / table_blasting.rb.svn-base
blob9b2efc3d4e43dcae72b1f0205cbdc3e2938ac8e2
1 module Scenarios
2   module TableBlasting
3     def self.included(base)
4       base.module_eval do
5         delegate :blasted_tables, :to => :table_config
6       end
7     end
8     
9     def blast_table(name) # :nodoc:
10       ActiveRecord::Base.silence do
11         ActiveRecord::Base.connection.delete "DELETE FROM #{name}", "Scenario Delete"
12       end
13       blasted_tables << name
14     end
15     
16     def prepare_table(name)
17       blast_table(name) unless blasted_tables.include?(name)
18     end
19   end
20 end