Class: Dataset::Database::Base
- Inherits:
-
Object
- Object
- Dataset::Database::Base
- Includes:
- FileUtils
- Defined in:
- lib/dataset/database/base.rb
Overview
Provides Dataset a way to clear, dump and load databases.
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#clear ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/dataset/database/base.rb', line 10 def clear connection = ActiveRecord::Base.connection ActiveRecord::Base.silence do connection.tables.each do |table_name| connection.delete "DELETE FROM #{connection.quote_table_name(table_name)}", "Dataset::Database#clear" unless table_name == ActiveRecord::Migrator.schema_migrations_table_name end end end |