lib/jsonapi/link_builder.rb in jsonapi-resources-0.5.3 vs lib/jsonapi/link_builder.rb in jsonapi-resources-0.5.4
- old
+ new
@@ -75,22 +75,22 @@
engine_name.routes.url_helpers.public_send(resource_path_name, source.id)
end
def engine_resource_path_name_from_source(source)
scopes = module_scopes_from_class(source.class)[1..-1]
- base_path_name = scopes.map { |scope| scope.downcase }.join("_")
+ base_path_name = scopes.map { |scope| scope.underscore }.join("_")
end_path_name = source.class._type.to_s.singularize
"#{ base_path_name }_#{ end_path_name }_path"
end
def engine_resource_url(source)
"#{ base_url }#{ engine_resource_path(source) }"
end
def engine_resources_path_name_from_class(klass)
scopes = module_scopes_from_class(klass)[1..-1]
- base_path_name = scopes.map { |scope| scope.downcase }.join("_")
+ base_path_name = scopes.map { |scope| scope.underscore }.join("_")
end_path_name = klass._type.to_s
"#{ base_path_name }_#{ end_path_name }_path"
end
def format_route(route)
@@ -99,10 +99,10 @@
def formatted_module_path_from_class(klass)
scopes = module_scopes_from_class(klass)
unless scopes.empty?
- "/#{ scopes.map(&:downcase).join('/') }/"
+ "/#{ scopes.map(&:underscore).join('/') }/"
else
"/"
end
end