6e50134a42
* Add trending links * Add overriding specific links trendability * Add link type to preview cards and only trend articles Change trends review notifications from being sent every 5 minutes to being sent every 2 hours Change threshold from 5 unique accounts to 15 unique accounts * Fix tests
33 lines
662 B
Ruby
33 lines
662 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Admin
|
|
class TagsController < BaseController
|
|
before_action :set_tag
|
|
|
|
def show
|
|
authorize @tag, :show?
|
|
|
|
@time_period = (6.days.ago.to_date...Time.now.utc.to_date)
|
|
end
|
|
|
|
def update
|
|
authorize @tag, :update?
|
|
|
|
if @tag.update(tag_params.merge(reviewed_at: Time.now.utc))
|
|
redirect_to admin_tag_path(@tag.id), notice: I18n.t('admin.tags.updated_msg')
|
|
else
|
|
render :show
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def set_tag
|
|
@tag = Tag.find(params[:id])
|
|
end
|
|
|
|
def tag_params
|
|
params.require(:tag).permit(:name, :trendable, :usable, :listable)
|
|
end
|
|
end
|
|
end
|