1
0
Fork 0
mirror of https://github.com/thoughtbot/factory_bot_rails.git synced 2022-11-09 11:49:18 -05:00

Append to paths instead of resetting them

Using `+=` instead of `=` will ensure that the engine does not overwrite definition_file_paths set elsewhere
This commit is contained in:
Daniel Colson 2019-06-21 10:53:53 -04:00 committed by GitHub
parent 7e44401667
commit 3815aae2b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,7 +72,7 @@ rescue LoadError
end
class MyEngine < ::Rails::Engine
config.factory_bot.definition_file_paths =
config.factory_bot.definition_file_paths +=
[File.expand_path('../factories', __FILE__)] if defined?(FactoryBotRails)
end
```