discourse/app/serializers/site_text_serializer.rb
2016-03-31 17:40:54 -04:00

23 lines
357 B
Ruby

class SiteTextSerializer < ApplicationSerializer
attributes :id, :value, :overridden?, :can_revert?
def id
object[:id]
end
def value
object[:value]
end
def overridden?
current_val = value
I18n.overrides_disabled do
return I18n.t(object[:id]) != current_val
end
end
alias_method :can_revert?, :overridden?
end