mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 23:06:50 +00:00
parent
56b61b1532
commit
7a093afd03
@ -27,8 +27,13 @@ module Rails
|
|||||||
def parent_class_name
|
def parent_class_name
|
||||||
if options[:parent]
|
if options[:parent]
|
||||||
options[:parent]
|
options[:parent]
|
||||||
else
|
# Only works on 3.2
|
||||||
|
# elsif (n = Rails::Generators.namespace) && n.const_defined?(:ApplicationSerializer)
|
||||||
|
# "ApplicationSerializer"
|
||||||
|
elsif defined?(::ApplicationSerializer)
|
||||||
"ApplicationSerializer"
|
"ApplicationSerializer"
|
||||||
|
else
|
||||||
|
"ActiveModel::Serializer"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user