From 464d37310ea71c7f95647e27c48b5225dc1f009d Mon Sep 17 00:00:00 2001 From: Jess Lee Date: Thu, 20 Jun 2019 09:34:03 -0400 Subject: [PATCH] add buffered checkbox to individual articles (#3238) --- app/controllers/internal/articles_controller.rb | 4 ++-- app/views/internal/articles/_individual_article.html.erb | 7 ++++++- app/views/internal/tools/index.html.erb | 1 - 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/controllers/internal/articles_controller.rb b/app/controllers/internal/articles_controller.rb index 079860927..4643ce552 100644 --- a/app/controllers/internal/articles_controller.rb +++ b/app/controllers/internal/articles_controller.rb @@ -72,7 +72,6 @@ class Internal::ArticlesController < Internal::ApplicationController article.boosted_additional_articles = article_params[:boosted_additional_articles].to_s == "true" article.boosted_dev_digest_email = article_params[:boosted_dev_digest_email].to_s == "true" article.user_id = article_params[:user_id].to_i - article.update!(article_params) Article.where.not(id: article.id).where(live_now: true).update_all(live_now: false) if article.live_now CacheBuster.new.bust "/live_articles" @@ -94,6 +93,7 @@ class Internal::ArticlesController < Internal::ApplicationController :boosted_dev_digest_email, :main_image_background_hex_color, :featured_number, - :user_id) + :user_id, + :last_buffered) end end diff --git a/app/views/internal/articles/_individual_article.html.erb b/app/views/internal/articles/_individual_article.html.erb index 253210718..df719bc7c 100644 --- a/app/views/internal/articles/_individual_article.html.erb +++ b/app/views/internal/articles/_individual_article.html.erb @@ -77,7 +77,12 @@

<% end %> - +   + <% if article.last_buffered %> + Last Buffered <%= article.last_buffered %> + <% else %> + Buffered: + <% end %>     diff --git a/app/views/internal/tools/index.html.erb b/app/views/internal/tools/index.html.erb index 5910c3f68..833161853 100644 --- a/app/views/internal/tools/index.html.erb +++ b/app/views/internal/tools/index.html.erb @@ -20,4 +20,3 @@ <%= text_field_tag :bust_user, nil, placeholder: "12345" %> <%= submit_tag("Clear Cache") %> <% end %> -