sutty/app/models/metadata_lang.rb

22 lines
340 B
Ruby
Raw Permalink 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