]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/diary_entries_controller.rb
Fix Lint/DuplicateBranch rubocop warnings
[rails.git] / app / controllers / diary_entries_controller.rb
index 312e1e54caf3464649fc52e71ff34e5a8fec32f4..467c4a38f280db468be0b611d6c336eee83eedd8 100644 (file)
@@ -60,9 +60,8 @@ class DiaryEntriesController < ApplicationController
     @title = t "diary_entries.edit.title"
     @diary_entry = DiaryEntry.find(params[:id])
 
     @title = t "diary_entries.edit.title"
     @diary_entry = DiaryEntry.find(params[:id])
 
-    if current_user != @diary_entry.user
-      redirect_to diary_entry_path(@diary_entry.user, @diary_entry)
-    elsif params[:diary_entry] && @diary_entry.update(entry_params)
+    if current_user != @diary_entry.user ||
+       (params[:diary_entry] && @diary_entry.update(entry_params))
       redirect_to diary_entry_path(@diary_entry.user, @diary_entry)
     else
       set_map_location
       redirect_to diary_entry_path(@diary_entry.user, @diary_entry)
     else
       set_map_location