Module: Cardio::Utils

Included in:
Cardio
Defined in:
lib/cardio/utils.rb

Overview

Utilities that may need to be run even when mods are not loaded.

Instance Method Summary collapse

Instance Method Details

#delete_tmp_files!(id = nil) ⇒ Object

deletes tmp directory within files directory It's here because it gets called as part of cache clearing, which sometimes gets called in a context where card mods are not loaded. Why does cache clearing need to do this??



12
13
14
15
16
17
# File 'lib/cardio/utils.rb', line 12

def delete_tmp_files! id=nil
  raise "no files directory" unless files_dir
  delete_tmp_files id
rescue StandardError
  Rails.logger.info "failed to remove tmp files"
end

#seed_test_dbObject



4
5
6
# File 'lib/cardio/utils.rb', line 4

def seed_test_db
  system "env RAILS_ENV=test bundle exec rake db:fixtures:load"
end