Skip to content
This repository has been archived by the owner on May 9, 2019. It is now read-only.

Commit

Permalink
FIX: delete should be destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
nirnanaaa committed Aug 30, 2013
1 parent d50a8b6 commit c8b2475
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Refactored find_or_initialize_by_name to be useable :)
* Returning nil on history if a page was not saved
* Added finding with version string

* Using activemodel convenient `destroy` and deprecated old `delete`

# 1.4.2 1th August 2013
* Found an issue that the Wiki was not updating from external pushes
Expand Down
14 changes: 12 additions & 2 deletions lib/gollum_rails/page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,19 +251,29 @@ def update_attributes(content=nil,name=nil,format=:markdown, commit=nil)
@gollum_page = page.update_page(gollum_page, wiki, content, get_right_commit(commit), name, format)
end
end

# == Deletes current page (also available static. See below)
#
# commit - optional. If given this commit will be used instead of that one, used
# to initialize the instance
#
# Returns the commit id of the current action as String
def delete(commit=nil)
def destroy(commit=nil)
run_callbacks :delete do
page.delete_page(gollum_page, wiki, get_right_commit(commit))
end
end

# == Deletes current page (also available static. See below)
#
# commit - optional. If given this commit will be used instead of that one, used
# to initialize the instance
#
# Returns the commit id of the current action as String
def delete(commit=nil)
destroy(commit)
end

# checks if entry already has been saved
#
#
Expand Down

0 comments on commit c8b2475

Please sign in to comment.