summaryrefslogtreecommitdiff
path: root/app/controllers/projects/snippets_controller.rb
diff options
context:
space:
mode:
authorAndrew8xx8 <avk@8xx8.ru>2013-03-25 16:28:39 +0400
committerAndrew8xx8 <avk@8xx8.ru>2013-03-25 16:28:39 +0400
commit0359f1d9ec286fbbf58027e2cdb2a307806f54da (patch)
tree6c89fadbbd99f51d6cf830955de8d1ebb0588d88 /app/controllers/projects/snippets_controller.rb
parent3e695acfa2f4035431cb325645b3114d06e43105 (diff)
downloadgitlab-ce-0359f1d9ec286fbbf58027e2cdb2a307806f54da.tar.gz
Codestyle improved
Diffstat (limited to 'app/controllers/projects/snippets_controller.rb')
-rw-r--r--app/controllers/projects/snippets_controller.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/app/controllers/projects/snippets_controller.rb b/app/controllers/projects/snippets_controller.rb
index 92e88de6790..1165fa1c583 100644
--- a/app/controllers/projects/snippets_controller.rb
+++ b/app/controllers/projects/snippets_controller.rb
@@ -29,9 +29,8 @@ class Projects::SnippetsController < Projects::ApplicationController
def create
@snippet = @project.snippets.build(params[:project_snippet])
@snippet.author = current_user
- @snippet.save
- if @snippet.valid?
+ if @snippet.save
redirect_to project_snippet_path(@project, @snippet)
else
respond_with(@snippet)
@@ -42,9 +41,7 @@ class Projects::SnippetsController < Projects::ApplicationController
end
def update
- @snippet.update_attributes(params[:project_snippet])
-
- if @snippet.valid?
+ if @snippet.update_attributes(params[:project_snippet])
redirect_to project_snippet_path(@project, @snippet)
else
respond_with(@snippet)