Module: Cardio::Utils
- Defined in:
- lib/cardio/utils.rb
Overview
Utilities that may need to be run even when mods are not loaded.
Class Method Summary collapse
-
.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.
- .seed_test_db ⇒ Object
Class 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??
13 14 15 16 17 18 19 |
# File 'lib/cardio/utils.rb', line 13 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_db ⇒ Object
5 6 7 |
# File 'lib/cardio/utils.rb', line 5 def seed_test_db system "env RAILS_ENV=test bundle exec rake db:fixtures:load" end |