mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Allow overriding the adapter with render option
Make it easy to use multiple adapters in an app. use "adapter: false" to not use ams make a test override config.adapter
This commit is contained in:
@@ -90,8 +90,7 @@ module ActiveModel
|
||||
def self.adapter
|
||||
adapter_class = case config.adapter
|
||||
when Symbol
|
||||
class_name = "ActiveModel::Serializer::Adapter::#{config.adapter.to_s.classify}"
|
||||
class_name.safe_constantize
|
||||
ActiveModel::Serializer::Adapter.adapter_class(config.adapter)
|
||||
when Class
|
||||
config.adapter
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user