mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 02:34:43 +08:00
21 lines
300 B
Ruby
21 lines
300 B
Ruby
class SiteTextSerializer < ApplicationSerializer
|
|
attributes :id, :value, :can_revert?
|
|
|
|
def id
|
|
object[:id]
|
|
end
|
|
|
|
def value
|
|
object[:value]
|
|
end
|
|
|
|
def can_revert?
|
|
current_val = value
|
|
|
|
I18n.overrides_disabled do
|
|
return I18n.t(object[:id]) != current_val
|
|
end
|
|
end
|
|
end
|
|
|