mirror of
https://github.com/mastodon/mastodon.git
synced 2025-06-07 05:39:14 +00:00
16 lines
330 B
Ruby
16 lines
330 B
Ruby
# frozen_string_literal: true
|
|
|
|
class REST::RuleSerializer < ActiveModel::Serializer
|
|
attributes :id, :text, :hint, :translations
|
|
|
|
def id
|
|
object.id.to_s
|
|
end
|
|
|
|
def translations
|
|
object.translations.to_h do |translation|
|
|
[translation.language, { text: translation.text, hint: translation.hint }]
|
|
end
|
|
end
|
|
end
|