Class: ArBigTableValue

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/ar_big_table_value.rb

Overview

Schema information

Table name: ar_big_table_value : Big Table - values

id Integer id created_at Time created_at updated_at Time updated_at value String Value to be returned locales String Translations written in YAML as en: English sl: Slovensko active Boolean Is Active created_by Integer created_by updated_by Integer updated_by ar_big_table_id Integer

Documents are embedded in ArBigTable document. Every value defined has its own description, which can further be translated in embedded ArBigTableLocale documents.

Instance Method Summary collapse

Instance Method Details

#get_localized_description(locale = I18n.locale.to_s) ⇒ Object



48
49
50
51
# File 'app/models/ar_big_table_value.rb', line 48

def get_localized_description(locale = I18n.locale.to_s)
  hash = YAML.load(locales) rescue {}
  hash&.dig(locale) || (description.blank? ? value : description)
end