Skip to content

Commit

Permalink
Fix typo resource_id
Browse files Browse the repository at this point in the history
This should be `get_resource_id`. The method `remove_method_description`
was not exercised by the specs so it wasn't caught. (see Apipie#864)

This was causing apipie to crash during application boot.
  • Loading branch information
stormsilver committed May 11, 2023
1 parent 43cbccd commit 759009e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/apipie/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def get_method_descriptions(resource, method)

def remove_method_description(resource, versions, method_name)
versions.each do |version|
resource = resource_id(resource)
resource = get_resource_id(resource)
if resource_description = get_resource_description("#{version}##{resource}")
resource_description.remove_method_description(method_name)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def create
def update
end

api :DELETE, "/architecturess/:id/", "Delete an architecture."
api! "Delete an architecture."
api_version "2.0" # forces removal of the method description
def destroy
end
end
Expand Down

0 comments on commit 759009e

Please sign in to comment.