Skip to content

Commit

Permalink
Dropped expiration date from the snippet API
Browse files Browse the repository at this point in the history
  • Loading branch information
jvanbaarsen committed Jan 11, 2014
1 parent 2eb1220 commit ef404d8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions doc/api/project_snippets.md
Expand Up @@ -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


Expand All @@ -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


Expand Down
4 changes: 0 additions & 4 deletions lib/api/project_snippets.rb
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit ef404d8

Please sign in to comment.