Skip to content

Commit

Permalink
Merge branch 'hotfix/0.3.1_fix'
Browse files Browse the repository at this point in the history
* hotfix/0.3.1_fix:
  Fix topic news
  • Loading branch information
kalashnikovisme committed Jul 15, 2015
2 parents 6bb7e67 + 6295e2b commit c889e4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/web/news_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ def index
def show
@news = News.find(params[:id]).decorate
unless @news.is_published?
#FIXME there 404 error path
redirect_to not_found_page_path
end
@activity_lines = @news.tags.activity_lines
@events = @news.tags.events
@teams = @news.tags.teams
topic_news_tags = @news.tags.last 2
@topic_news = []
topic_news_tags.each do |tag|
news_tag = Tag.where(target_type: tag.target_type, record_type: 'News').where("record_id != #{@news.id}").last
news_tag = Tag.where(target_type: tag.target_type, record_type: 'News').where("record_id != #{@news.id}").order('published_at DESC').last
@topic_news << NewsDecorator.decorate(news_tag.record) if news_tag
end
@last_news = NewsDecorator.decorate_collection News.published.first 3
Expand Down

0 comments on commit c889e4e

Please sign in to comment.