Method: Graphiti.setup!
- Defined in:
- lib/graphiti.rb
.setup! ⇒ Object
When we add a sideload, we need to do configuration, such as adding the relationship to the Resource’s serializer. However, the sideload’s Resource class may not be loaded yet.
This is not a problem when Rails autoloading, but is a problem when eager loading, or not using Rails.
So, load every Resource class then call Graphiti.setup!
108 109 110 111 112 |
# File 'lib/graphiti.rb', line 108 def self.setup! resources.each do |r| r.apply_sideloads_to_serializer end end |