From 9aeeed140fbc611af656a84d0228d2ca436cc019 Mon Sep 17 00:00:00 2001 From: Wen-Tien Chang Date: Mon, 4 Jan 2010 17:37:55 +0800 Subject: [PATCH] let admin/announcement works --- app/models/announcement.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/models/announcement.rb b/app/models/announcement.rb index 3bf1ffb3..ea8c2edc 100644 --- a/app/models/announcement.rb +++ b/app/models/announcement.rb @@ -3,11 +3,20 @@ class Announcement include MongoMapper::Document key :title_en, String + key :title_zh_tw, String key :content_en, String key :content_zh_tw, String def to_liquid - { "id" => self.id, "title" => self.title, "content" => self.content } + { "id" => self.id, "title" => self.send("title_#{I18n.locale}"), "content" => self.send("content_#{I18n.locale}") } end + def title + self.send("title_#{I18n.locale}") + end + + def content + self.send("content_#{I18n.locale}") + end + end \ No newline at end of file