mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 06:16:50 +00:00
Object.const_get differs on 2.0 and 2.1.2. So rescue from NameError
This commit is contained in:
parent
b4a313e6d8
commit
139609355f
@ -80,8 +80,10 @@ module ActiveModel
|
||||
adapter_class = case config.adapter
|
||||
when Symbol
|
||||
class_name = "ActiveModel::Serializer::Adapter::#{config.adapter.to_s.classify}"
|
||||
if Object.const_defined?(class_name)
|
||||
begin
|
||||
Object.const_get(class_name)
|
||||
rescue NameError
|
||||
nil
|
||||
end
|
||||
when Class
|
||||
config.adapter
|
||||
|
||||
Loading…
Reference in New Issue
Block a user