diff options
author | BatedUrGonnaDie <batedurgonnadie@yahoo.com> | 2019-04-09 00:35:16 -0700 |
---|---|---|
committer | BatedUrGonnaDie <batedurgonnadie@yahoo.com> | 2019-04-09 00:35:16 -0700 |
commit | 75811c37a9c1cc7d6977cd841437d136d4b95440 (patch) | |
tree | b92c2322bc4a32800151834c69e24c42ac808620 /railties/lib/rails | |
parent | 496e8ee9370e9f165fd1f5d2620296299a6a8649 (diff) | |
download | rails-75811c37a9c1cc7d6977cd841437d136d4b95440.tar.gz rails-75811c37a9c1cc7d6977cd841437d136d4b95440.tar.bz2 rails-75811c37a9c1cc7d6977cd841437d136d4b95440.zip |
Only override async adapter when seeding
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/engine.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/railties/lib/rails/engine.rb b/railties/lib/rails/engine.rb index 778bbebe75..eb2f0e8fca 100644 --- a/railties/lib/rails/engine.rb +++ b/railties/lib/rails/engine.rb @@ -550,7 +550,13 @@ module Rails # Blog::Engine.load_seed def load_seed seed_file = paths["db/seeds.rb"].existent.first - with_inline_jobs { load(seed_file) } if seed_file + return unless seed_file + + if config.active_job.queue_adapter == :async + with_inline_jobs { load(seed_file) } + else + load(seed_file) + end end # Add configured load paths to Ruby's load path, and remove duplicate entries. |