mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Use case/when
This commit is contained in:
parent
afb3d4f9e5
commit
bc9bd5765b
1 changed files with 3 additions and 2 deletions
|
@ -6,7 +6,8 @@ module ActiveJob
|
||||||
mattr_reader(:queue_adapter) { ActiveJob::QueueAdapters::InlineAdapter }
|
mattr_reader(:queue_adapter) { ActiveJob::QueueAdapters::InlineAdapter }
|
||||||
|
|
||||||
def queue_adapter=(name_or_adapter)
|
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)
|
adapter = load_adapter(name_or_adapter)
|
||||||
else
|
else
|
||||||
adapter = name_or_adapter
|
adapter = name_or_adapter
|
||||||
|
|
Loading…
Reference in a new issue