let admin/announcement works
This commit is contained in:
parent
736eda103a
commit
9aeeed140f
|
@ -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
|
Loading…
Reference in New Issue