Handle inflecting api to s/API/Api without side-effects

This commit is contained in:
Benjamin Fleischer
2015-07-17 14:08:50 -05:00
parent 506739d4fb
commit 4359026c0e

View File

@@ -33,7 +33,8 @@ module ActiveModel
end
def self.adapter_class(adapter)
"ActiveModel::Serializer::Adapter::#{adapter.to_s.classify}".safe_constantize
adapter_name = adapter.to_s.classify.sub("API", "Api")
"ActiveModel::Serializer::Adapter::#{adapter_name}".safe_constantize
end
def fragment_cache(*args)