mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Ensure generator picks up ApplicationSerializer
ApplicationSerializer could exist, but not be loaded. So, we check existence by looking at the filesystem instead of defined?. Fixes https://github.com/rails-api/active_model_serializers/issues/1890
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user