Class: NestedScenarios
- Defined in:
- lib/nested_scenarios/nested_scenarios.rb
Defined Under Namespace
Classes: Builder
Constant Summary collapse
- @@record_name_fields =
%w( name username title )
- @@skip_tables =
%w( schema_migrations )
Class Method Summary collapse
- .delete_tables(table_names = self.tables) ⇒ Object
- .load_root_fixtures ⇒ Object
- .load_root_fixtures=(value) ⇒ Object
- .tables ⇒ Object
Class Method Details
.delete_tables(table_names = self.tables) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/nested_scenarios/nested_scenarios.rb', line 6 def self.delete_tables(table_names = self.tables) connection = ActiveRecord::Base.connection ActiveRecord::Base.silence do connection.disable_referential_integrity do (table_names - @@skip_tables).each do |table_name| connection.delete "DELETE FROM #{table_name}", 'Fixture Delete' end end end end |
.load_root_fixtures ⇒ Object
25 26 27 |
# File 'lib/nested_scenarios/nested_scenarios.rb', line 25 def self.load_root_fixtures Test::Unit::TestCase.load_root_fixtures end |
.load_root_fixtures=(value) ⇒ Object
21 22 23 |
# File 'lib/nested_scenarios/nested_scenarios.rb', line 21 def self.load_root_fixtures=(value) Test::Unit::TestCase.load_root_fixtures = value end |
.tables ⇒ Object
17 18 19 |
# File 'lib/nested_scenarios/nested_scenarios.rb', line 17 def self.tables ActiveRecord::Base.connection.tables - @@skip_tables end |