X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/9e158a5d393bf9da73473f54353420937baf992f..58e95f7ea46accda6359b187ce5936aad4ac5945:/app/controllers/diary_entries_controller.rb?ds=sidebyside diff --git a/app/controllers/diary_entries_controller.rb b/app/controllers/diary_entries_controller.rb index f827bac3f..ba2a2976e 100644 --- a/app/controllers/diary_entries_controller.rb +++ b/app/controllers/diary_entries_controller.rb @@ -129,7 +129,7 @@ class DiaryEntriesController < ApplicationController elsif params[:friends] if current_user @title = t "diary_entries.index.title_friends" - @entries = DiaryEntry.where(:user_id => current_user.friend_users) + @entries = DiaryEntry.where(:user_id => current_user.friends) else require_user return @@ -235,11 +235,12 @@ class DiaryEntriesController < ApplicationController end def comments + conditions = { :user_id => @user } + + conditions[:visible] = true unless current_user&.administrator? + @comment_pages, @comments = paginate(:diary_comments, - :conditions => { - :user_id => @user, - :visible => true - }, + :conditions => conditions, :order => "created_at DESC", :per_page => 20) @page = (params[:page] || 1).to_i