From cf9701addf351a492573318f726f1c37cfc40ef4 Mon Sep 17 00:00:00 2001 From: Duncan <52967253+dunkOnIT@users.noreply.github.com> Date: Tue, 10 Oct 2023 11:30:41 +0200 Subject: [PATCH] Update README.md Added note about requiring models in RSpec tests --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ff32ff17..b22b93d9 100644 --- a/README.md +++ b/README.md @@ -1293,6 +1293,12 @@ RSpec.configure do |config| end ``` +In addition, the first test for each model may fail if the relevant models are not included in `included_models`. This can be fixed by adding this line before the `DynamoidReset` module: +```ruby +Dir[File.join(Dynamoid::Config.models_dir, '**/*.rb')].each { |file| require file } +``` +Note that this will require _all_ models in your models folder - you can also explicitly require only certain models if you would prefer to. + In Rails, you may also want to ensure you do not delete non-test data accidentally by adding the following to your test environment setup: