Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Dropped expiration date from the snippet API

  • Loading branch information...
commit ef404d8ea62f277ec40d9a0a82c08d389b07b54e 1 parent 2eb1220
@jvanbaarsen jvanbaarsen authored
Showing with 0 additions and 6 deletions.
  1. +0 −2  doc/api/project_snippets.md
  2. +0 −4 lib/api/project_snippets.rb
View
2  doc/api/project_snippets.md
@@ -57,7 +57,6 @@ Parameters:
+ `id` (required) - The ID of a project
+ `title` (required) - The title of a snippet
+ `file_name` (required) - The name of a snippet file
-+ `lifetime` (optional) - The expiration date of a snippet
+ `code` (required) - The content of a snippet
@@ -75,7 +74,6 @@ Parameters:
+ `snippet_id` (required) - The ID of a project's snippet
+ `title` (optional) - The title of a snippet
+ `file_name` (optional) - The name of a snippet file
-+ `lifetime` (optional) - The expiration date of a snippet
+ `code` (optional) - The content of a snippet
View
4 lib/api/project_snippets.rb
@@ -41,7 +41,6 @@ def handle_project_member_errors(errors)
# id (required) - The ID of a project
# title (required) - The title of a snippet
# file_name (required) - The name of a snippet file
- # lifetime (optional) - The expiration date of a snippet
# code (required) - The content of a snippet
# Example Request:
# POST /projects/:id/snippets
@@ -50,7 +49,6 @@ def handle_project_member_errors(errors)
required_attributes! [:title, :file_name, :code]
attrs = attributes_for_keys [:title, :file_name]
- attrs[:expires_at] = params[:lifetime] if params[:lifetime].present?
attrs[:content] = params[:code] if params[:code].present?
@snippet = user_project.snippets.new attrs
@snippet.author = current_user
@@ -69,7 +67,6 @@ def handle_project_member_errors(errors)
# snippet_id (required) - The ID of a project snippet
# title (optional) - The title of a snippet
# file_name (optional) - The name of a snippet file
- # lifetime (optional) - The expiration date of a snippet
# code (optional) - The content of a snippet
# Example Request:
# PUT /projects/:id/snippets/:snippet_id
@@ -78,7 +75,6 @@ def handle_project_member_errors(errors)
authorize! :modify_project_snippet, @snippet
attrs = attributes_for_keys [:title, :file_name]
- attrs[:expires_at] = params[:lifetime] if params[:lifetime].present?
attrs[:content] = params[:code] if params[:code].present?
if @snippet.update_attributes attrs
Please sign in to comment.
Something went wrong with that request. Please try again.