Impressionist

This commit is contained in:
manson 2014-05-15 19:27:05 +08:00
parent 420a302ee8
commit 687a1443ce
2 changed files with 4 additions and 2 deletions

View File

@ -37,6 +37,7 @@ class AnnouncementsController < ApplicationController
def show def show
params = OrbitHelper.params params = OrbitHelper.params
announcement = Bulletin.can_display.find_by(:uid=>params[:uid]) announcement = Bulletin.can_display.find_by(:uid=>params[:uid])
tags = announcement.tags.map{|tag| { "tag" => tag.name } } rescue [] tags = announcement.tags.map{|tag| { "tag" => tag.name } } rescue []
@ -53,7 +54,8 @@ class AnnouncementsController < ApplicationController
"updated_at" => announcement.updated_at.strftime('%Y-%m-%d %H:%M'), "updated_at" => announcement.updated_at.strftime('%Y-%m-%d %H:%M'),
"body" =>announcement.text, "body" =>announcement.text,
"image" => announcement.image.url "image" => announcement.image.url
} },
"impressionist" => announcement
} }
end end

View File

@ -1,9 +1,9 @@
class Bulletin class Bulletin
include Mongoid::Document include Mongoid::Document
include Mongoid::Timestamps include Mongoid::Timestamps
include Impressionist::Impressionable
include OrbitModel::Status include OrbitModel::Status
include OrbitModel::Impression
include OrbitTag::Taggable include OrbitTag::Taggable
include OrbitCategory::Categorizable include OrbitCategory::Categorizable
include Slug include Slug