5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 16:36:22 +00:00
panel/app/models/metadata_lang.rb

22 lines
340 B
Ruby
Raw Normal View History

# frozen_string_literal: true
# Un campo de idioma
class MetadataLang < MetadataTemplate
def default_value
super || I18n.locale
end
# @return [Symbol]
def document_value
document.collection.label.to_sym
2021-02-17 21:40:07 +00:00
end
def value
self[:value] ||= document_value || default_value
end
def values
2020-05-23 15:38:03 +00:00
site.locales
end
end