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.

(cherry picked from commit 759009e)
  • Loading branch information
stormsilver committed May 12, 2023
1 parent 2ef42f5 commit f267771
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 @@ -226,7 +226,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 f267771

Please sign in to comment.