diff --git a/README.md b/README.md index 754f3da..92800ed 100644 --- a/README.md +++ b/README.md @@ -66,9 +66,14 @@ This will cause factory\_bot\_rails to automatically load factories in It is possible to use this setting to share factories from a gem: ```rb +begin + require 'factory_bot_rails' +rescue LoadError +end + class MyEngine < ::Rails::Engine config.factory_bot.definition_file_paths = - File.expand_path('../factories', __FILE__) if defined?(FactoryBotRails) + [File.expand_path('../factories', __FILE__)] if defined?(FactoryBotRails) end ```