mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
Always return an enumerator
This commit is contained in:
parent
3fb72d94b5
commit
3ba4a8c9b2
@ -332,10 +332,9 @@ module ActiveModel
|
||||
# @param [JSONAPI::IncludeDirective] include_directive (defaults to the
|
||||
# +default_include_directive+ config value when not provided)
|
||||
# @return [Enumerator<Association>]
|
||||
#
|
||||
def associations(include_directive = ActiveModelSerializers.default_include_directive, include_slice = nil)
|
||||
include_slice ||= include_directive
|
||||
return unless object
|
||||
return Enumerator.new unless object
|
||||
|
||||
Enumerator.new do |y|
|
||||
self.class._reflections.values.each do |reflection|
|
||||
|
||||
Loading…
Reference in New Issue
Block a user