The code powering m.abunchtell.com https://m.abunchtell.com
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

21 wiersze
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