Skip to content

Commit

Permalink
Handle inflecting api to s/API/Api without side-effects
Browse files Browse the repository at this point in the history
  • Loading branch information
bf4 committed Jul 17, 2015
1 parent 506739d commit 4359026
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/active_model/serializer/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def self.create(resource, options = {})
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)
Expand All @@ -42,7 +43,7 @@ def fragment_cache(*args)

private

def cache_check(serializer)
def cache_check(serializer)
@cached_serializer = serializer
@klass = @cached_serializer.class
if is_cached?
Expand Down

0 comments on commit 4359026

Please sign in to comment.