lib/jsonapi/include_directives.rb in jsonapi-resources-0.9.0 vs lib/jsonapi/include_directives.rb in jsonapi-resources-0.9.1.beta1
- old
+ new
@@ -50,10 +50,10 @@
if current_resource_klass
current_relationship = current_resource_klass._relationships[fragment]
current_resource_klass = current_relationship.try(:resource_klass)
else
- warn "[RELATIONSHIP NOT FOUND] Relationship could not be found for #{current_path}."
+ raise JSONAPI::Exceptions::InvalidInclude.new(current_resource_klass, current_path)
end
include_in_join = @force_eager_load || !current_relationship || current_relationship.eager_load_on_include
current[:include_related][fragment] ||= { include: false, include_related: {}, include_in_join: include_in_join }