1
0
Fork 0
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:
Abdelkader Boudih 2014-05-19 10:53:25 +00:00
parent afb3d4f9e5
commit bc9bd5765b

View file

@ -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