mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 19:37:55 +08:00
30990006a9
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
28 lines
713 B
Ruby
28 lines
713 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'enum_site_setting'
|
|
|
|
class EmojiSetSiteSetting < EnumSiteSetting
|
|
|
|
def self.valid_value?(val)
|
|
values.any? { |v| v[:value] == val.to_s }
|
|
end
|
|
|
|
def self.values
|
|
@values ||= [
|
|
{ name: 'emoji_set.apple_international', value: 'apple' },
|
|
{ name: 'emoji_set.google', value: 'google' },
|
|
{ name: 'emoji_set.twitter', value: 'twitter' },
|
|
{ name: 'emoji_set.emoji_one', value: 'emoji_one' },
|
|
{ name: 'emoji_set.win10', value: 'win10' },
|
|
{ name: 'emoji_set.google_classic', value: 'google_classic' },
|
|
{ name: 'emoji_set.facebook_messenger', value: 'facebook_messenger' },
|
|
]
|
|
end
|
|
|
|
def self.translate_names?
|
|
true
|
|
end
|
|
|
|
end
|