From 687a1443ce69e73285dac52fa193c05a24177adf Mon Sep 17 00:00:00 2001 From: manson Date: Thu, 15 May 2014 19:27:05 +0800 Subject: [PATCH] Impressionist --- app/controllers/announcements_controller.rb | 4 +++- app/models/bulletin.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/announcements_controller.rb b/app/controllers/announcements_controller.rb index 914e438..b2202b5 100644 --- a/app/controllers/announcements_controller.rb +++ b/app/controllers/announcements_controller.rb @@ -37,6 +37,7 @@ class AnnouncementsController < ApplicationController def show params = OrbitHelper.params + announcement = Bulletin.can_display.find_by(:uid=>params[:uid]) 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'), "body" =>announcement.text, "image" => announcement.image.url - } + }, + "impressionist" => announcement } end diff --git a/app/models/bulletin.rb b/app/models/bulletin.rb index aeae020..a077ed1 100644 --- a/app/models/bulletin.rb +++ b/app/models/bulletin.rb @@ -1,9 +1,9 @@ class Bulletin include Mongoid::Document include Mongoid::Timestamps - include Impressionist::Impressionable include OrbitModel::Status + include OrbitModel::Impression include OrbitTag::Taggable include OrbitCategory::Categorizable include Slug