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.
 
 
 
 

26 linhas
500 B

  1. # frozen_string_literal: true
  2. class REST::CustomEmojiSerializer < ActiveModel::Serializer
  3. include RoutingHelper
  4. attributes :shortcode, :url, :static_url, :visible_in_picker
  5. attribute :category, if: :category_loaded?
  6. def url
  7. full_asset_url(object.image.url)
  8. end
  9. def static_url
  10. full_asset_url(object.image.url(:static))
  11. end
  12. def category
  13. object.category.name
  14. end
  15. def category_loaded?
  16. object.association(:category).loaded? && object.category.present?
  17. end
  18. end