Module: PGSpecHelper::Reset

Included in:
PGSpecHelper
Defined in:
lib/pg_spec_helper/reset.rb

Instance Method Summary collapse

Instance Method Details

#reset!(force = false) ⇒ Object

reset the database to its original state



4
5
6
7
8
9
10
11
12
# File 'lib/pg_spec_helper/reset.rb', line 4

def reset! force = false
  if force || has_changes?
    delete_all_schemas
    # refresh all materialized views
    refresh_all_materialized_views
    # reset the tracking of changes
    @methods_used = {}
  end
end