Orbit/app/models/announcement.rb

22 lines
457 B
Ruby
Raw Normal View History

2010-01-04 07:52:30 +00:00
class Announcement
2009-06-01 02:54:16 +00:00
2010-01-04 07:52:30 +00:00
include MongoMapper::Document
key :title_en, String
2010-01-04 09:37:55 +00:00
key :title_zh_tw, String
2010-01-04 07:52:30 +00:00
key :content_en, String
key :content_zh_tw, String
2009-06-01 02:54:16 +00:00
def to_liquid
2010-01-04 09:37:55 +00:00
{ "id" => self.id, "title" => self.send("title_#{I18n.locale}"), "content" => self.send("content_#{I18n.locale}") }
2009-06-01 02:54:16 +00:00
end
2010-01-04 09:37:55 +00:00
def title
self.send("title_#{I18n.locale}")
end
def content
self.send("content_#{I18n.locale}")
end
2009-06-01 02:54:16 +00:00
end