From ea2ef16ea42d61b34653246a76ab2a5ba767ec15 Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Tue, 23 May 2017 22:04:23 +0900 Subject: Cover StreamEntriesController more and remove redundant instructions (#3257) * Cover StreamEntriesController more * Remove redundant instructions in StreamEntriesController --- app/controllers/stream_entries_controller.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/stream_entries_controller.rb b/app/controllers/stream_entries_controller.rb index a9ee73500..baff4317a 100644 --- a/app/controllers/stream_entries_controller.rb +++ b/app/controllers/stream_entries_controller.rb @@ -11,12 +11,8 @@ class StreamEntriesController < ApplicationController def show respond_to do |format| format.html do - return gone if @stream_entry.activity.nil? - - if @stream_entry.activity_type == 'Status' - @ancestors = @stream_entry.activity.reply? ? cache_collection(@stream_entry.activity.ancestors(current_account), Status) : [] - @descendants = cache_collection(@stream_entry.activity.descendants(current_account), Status) - end + @ancestors = @stream_entry.activity.reply? ? cache_collection(@stream_entry.activity.ancestors(current_account), Status) : [] + @descendants = cache_collection(@stream_entry.activity.descendants(current_account), Status) end format.atom do @@ -46,7 +42,7 @@ class StreamEntriesController < ApplicationController @stream_entry = @account.stream_entries.where(activity_type: 'Status').find(params[:id]) @type = @stream_entry.activity_type.downcase - raise ActiveRecord::RecordNotFound if @stream_entry.activity.nil? || (@stream_entry.hidden? && (@stream_entry.activity_type != 'Status' || (@stream_entry.activity_type == 'Status' && !@stream_entry.activity.permitted?(current_account)))) + raise ActiveRecord::RecordNotFound if @stream_entry.activity.nil? || (@stream_entry.hidden? && !@stream_entry.activity.permitted?(current_account)) end def check_account_suspension -- cgit