mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Remove extra reflection classes
This commit is contained in:
parent
7d8fb1606b
commit
34d55e4729
@ -1,7 +1,7 @@
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
# @api private
|
||||
class BelongsToReflection < SingularReflection
|
||||
class BelongsToReflection < Reflection
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
# @api private
|
||||
class CollectionReflection < Reflection
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -1,8 +1,8 @@
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
# @api private
|
||||
class HasManyReflection < CollectionReflection
|
||||
def to_many?
|
||||
class HasManyReflection < Reflection
|
||||
def collection?
|
||||
true
|
||||
end
|
||||
end
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
# @api private
|
||||
class HasOneReflection < SingularReflection
|
||||
class HasOneReflection < Reflection
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@ -121,7 +121,7 @@ module ActiveModel
|
||||
:nil
|
||||
end
|
||||
|
||||
def to_many?
|
||||
def collection?
|
||||
false
|
||||
end
|
||||
|
||||
@ -235,7 +235,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def build_serializer!(association_value, serializer_class, parent_serializer, parent_serializer_options)
|
||||
if to_many?
|
||||
if collection?
|
||||
build_association_collection_serializer(parent_serializer, parent_serializer_options, association_value, serializer_class)
|
||||
else
|
||||
build_association_serializer(parent_serializer, parent_serializer_options, association_value, serializer_class)
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
module ActiveModel
|
||||
class Serializer
|
||||
# @api private
|
||||
class SingularReflection < Reflection
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user