Merge pull request #1912 from richmolj/generator

Ensure generator picks up ApplicationSerializer
This commit is contained in:
Lee Richmond
2016-09-06 12:42:37 -07:00
committed by GitHub
3 changed files with 24 additions and 6 deletions

View File

@@ -25,7 +25,7 @@ module Rails
def parent_class_name
if options[:parent]
options[:parent]
elsif defined?(::ApplicationSerializer)
elsif 'ApplicationSerializer'.safe_constantize
'ApplicationSerializer'
else
'ActiveModel::Serializer'