stories: if the user can't see the story, just return a 404
This commit is contained in:
parent
1b79d6dd45
commit
f9d46c666b
|
@ -126,12 +126,11 @@ class StoriesController < ApplicationController
|
||||||
return redirect_to @story.merged_into_story.comments_path
|
return redirect_to @story.merged_into_story.comments_path
|
||||||
end
|
end
|
||||||
|
|
||||||
if @story.can_be_seen_by_user?(@user)
|
if !@story.can_be_seen_by_user?(@user)
|
||||||
@title = @story.title
|
raise ActionController::RoutingError.new("story gone")
|
||||||
else
|
|
||||||
@title = "[Story removed]"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@title = @story.title
|
||||||
@short_url = @story.short_id_url
|
@short_url = @story.short_id_url
|
||||||
|
|
||||||
@comments = @story.merged_comments.includes(:user, :story, :hat,
|
@comments = @story.merged_comments.includes(:user, :story, :hat,
|
||||||
|
|
Loading…
Reference in a new issue