lib/jsonapi/link_builder.rb in jsonapi-resources-0.8.0 vs lib/jsonapi/link_builder.rb in jsonapi-resources-0.8.1
- old
+ new
@@ -93,10 +93,15 @@
def engine_resources_path_name_from_class(klass)
scopes = module_scopes_from_class(klass)[1..-1]
base_path_name = scopes.map { |scope| scope.underscore }.join("_")
end_path_name = klass._type.to_s
- "#{ base_path_name }_#{ end_path_name }_path"
+
+ if base_path_name.blank?
+ "#{ end_path_name }_path"
+ else
+ "#{ base_path_name }_#{ end_path_name }_path"
+ end
end
def format_route(route)
route_formatter.format(route)
end