tracks/vendor/plugins/scenarios/lib/scenarios/table_blasting.rb
2008-06-24 20:35:30 +02:00

20 lines
No EOL
488 B
Ruby

module Scenarios
module TableBlasting
def self.included(base)
base.module_eval do
delegate :blasted_tables, :to => :table_config
end
end
def blast_table(name) # :nodoc:
ActiveRecord::Base.silence do
ActiveRecord::Base.connection.delete "DELETE FROM #{name}", "Scenario Delete"
end
blasted_tables << name
end
def prepare_table(name)
blast_table(name) unless blasted_tables.include?(name)
end
end
end