Class: DataMapper::Adapters::Sqlite3Adapter
- Inherits:
-
DataObjectsAdapter
- Object
- DataObjectsAdapter
- DataMapper::Adapters::Sqlite3Adapter
- Defined in:
- lib/database_cleaner/data_mapper/truncation.rb
Instance Method Summary collapse
-
#disable_referential_integrity ⇒ Object
this is a no-op copied from activerecord i didn’t find out if/how this is possible activerecord also doesn’t do more here.
-
#storage_names(repository = :default) ⇒ Object
taken from github.com/godfat/dm-mapping/tree/master.
- #truncate_table(table_name) ⇒ Object
Instance Method Details
#disable_referential_integrity ⇒ Object
this is a no-op copied from activerecord i didn’t find out if/how this is possible activerecord also doesn’t do more here
59 60 61 |
# File 'lib/database_cleaner/data_mapper/truncation.rb', line 59 def disable_referential_integrity yield end |
#storage_names(repository = :default) ⇒ Object
taken from github.com/godfat/dm-mapping/tree/master
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/database_cleaner/data_mapper/truncation.rb', line 41 def storage_names(repository = :default) # activerecord-2.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb: 177 sql = <<-SQL.compress_lines SELECT name FROM sqlite_master WHERE type = 'table' AND NOT name = 'sqlite_sequence' SQL # activerecord-2.1.0/lib/active_record/connection_adapters/sqlite_adapter.rb: 181 query sql end |
#truncate_table(table_name) ⇒ Object
52 53 54 |
# File 'lib/database_cleaner/data_mapper/truncation.rb', line 52 def truncate_table(table_name) execute("DELETE FROM #{quote_table_name(table_name)};") end |