The code powering m.abunchtell.com https://m.abunchtell.com
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

21 linhas
534 B

  1. # frozen_string_literal: true
  2. class Api::V1::FeaturedTags::SuggestionsController < Api::BaseController
  3. before_action -> { doorkeeper_authorize! :read, :'read:accounts' }, only: :index
  4. before_action :require_user!
  5. before_action :set_most_used_tags, only: :index
  6. respond_to :json
  7. def index
  8. render json: @most_used_tags, each_serializer: REST::TagSerializer
  9. end
  10. private
  11. def set_most_used_tags
  12. @most_used_tags = Tag.most_used(current_account).where.not(id: current_account.featured_tags).limit(10)
  13. end
  14. end