lib/jsonapi/resource.rb in jsonapi-resources-0.9.7 vs lib/jsonapi/resource.rb in jsonapi-resources-0.9.8
- old
+ new
@@ -678,10 +678,10 @@
def apply_includes(records, options = {})
include_directives = options[:include_directives]
if include_directives
model_includes = resolve_relationship_names_to_relations(self, include_directives.model_includes, options)
- records = records.includes(model_includes)
+ records = records.includes(model_includes) if model_includes.present?
end
records
end