mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
User String#constantize instead of Object.const_get
This commit is contained in:
parent
139609355f
commit
77847d7c02
@ -69,7 +69,7 @@ module ActiveModel
|
||||
serializer_name = "#{resource.class.name}Serializer"
|
||||
|
||||
begin
|
||||
Object.const_get(serializer_name)
|
||||
serializer_name.constantize
|
||||
rescue NameError
|
||||
nil
|
||||
end
|
||||
@ -81,7 +81,7 @@ module ActiveModel
|
||||
when Symbol
|
||||
class_name = "ActiveModel::Serializer::Adapter::#{config.adapter.to_s.classify}"
|
||||
begin
|
||||
Object.const_get(class_name)
|
||||
class_name.constantize
|
||||
rescue NameError
|
||||
nil
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user