Refactor articles_controller (#11122)
Refactor unless statement and remove unused variables from controller
This commit is contained in:
parent
75fe6fd245
commit
b0ee1c3905
1 changed files with 1 additions and 6 deletions
|
|
@ -30,16 +30,11 @@ class ArticlesController < ApplicationController
|
|||
@articles.where(featured: true).includes(:user)
|
||||
end
|
||||
|
||||
unless @articles&.any?
|
||||
not_found
|
||||
end
|
||||
not_found unless @articles&.any?
|
||||
|
||||
set_surrogate_key_header "feed"
|
||||
set_cache_control_headers(10.minutes.to_i, stale_while_revalidate: 30, stale_if_error: 1.day.to_i)
|
||||
|
||||
@allowed_tags = FEED_ALLOWED_TAGS
|
||||
@allowed_attributes = FEED_ALLOWED_ATTRIBUTES
|
||||
|
||||
render layout: false, locals: {
|
||||
articles: @articles,
|
||||
user: @user,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue