Add event_end_date

This commit is contained in:
chiu 2026-06-05 07:37:08 +00:00
parent 68dcf25f25
commit 1025cb4438
1 changed files with 24 additions and 24 deletions

View File

@ -3,7 +3,7 @@ class EventNewsCustomTitle
include Mongoid::Timestamps include Mongoid::Timestamps
field :key field :key
field :title, type: String, localize: true field :title, type: String, localize: true
KEYS = ['category', 'title','speaker','host','event_date','place','notes'] KEYS = ['category', 'title','speaker','host','event_date','event_end_date','place','notes']
def self.get_map def self.get_map
KEYS.map do |k| KEYS.map do |k|
s = self.where(key: k).first || self.create(key: k,title_translations: I18n.available_locales.map{|l| [l,I18n.with_locale(l){I18n.t("event_news.#{k}")}]}.to_h) s = self.where(key: k).first || self.create(key: k,title_translations: I18n.available_locales.map{|l| [l,I18n.with_locale(l){I18n.t("event_news.#{k}")}]}.to_h)