Module: Encore::Serializer::MainResourceLinksManager
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/encore/serializer/main_resource_links_manager.rb,
lib/encore/serializer/main_resource_links_manager/reflection_has_one.rb,
lib/encore/serializer/main_resource_links_manager/reflection_has_many.rb,
lib/encore/serializer/main_resource_links_manager/reflection_belongs_to.rb
Defined Under Namespace
Modules: ReflectionBelongsTo, ReflectionHasMany, ReflectionHasOne
Class Method Summary collapse
Class Method Details
.add(collection, reflections, option_include) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/encore/serializer/main_resource_links_manager.rb', line 10 def self.add(collection, reflections, option_include) collection.each_with_object(Hash.new(Set.new)) do |resource, memo| option_include.each do |inclusion| model, ids = association_collection(resource, inclusion, reflections) memo[model] += ids end end end |