From bc9bd5765b8282b3004b3db2789dd42229137fa7 Mon Sep 17 00:00:00 2001 From: Abdelkader Boudih Date: Mon, 19 May 2014 10:53:25 +0000 Subject: [PATCH] Use case/when --- lib/active_job/queue_adapter.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/active_job/queue_adapter.rb b/lib/active_job/queue_adapter.rb index a1987a7dc3..2033f6fe56 100644 --- a/lib/active_job/queue_adapter.rb +++ b/lib/active_job/queue_adapter.rb @@ -6,12 +6,13 @@ module ActiveJob mattr_reader(:queue_adapter) { ActiveJob::QueueAdapters::InlineAdapter } def queue_adapter=(name_or_adapter) - if name_or_adapter.is_a?(Symbol) || name_or_adapter.is_a?(String) + case name_or_adapter + when Symbol, String adapter = load_adapter(name_or_adapter) else adapter = name_or_adapter end - + @@queue_adapter = adapter end