BUGFIX: flag topic broke all liking on the sites

This commit is contained in:
Sam 2014-02-13 12:56:31 +11:00
parent f73a3f252a
commit 5d7a33a799
1 changed files with 4 additions and 1 deletions

View File

@ -65,7 +65,10 @@ class PostActionsController < ApplicationController
def fetch_post_from_params
params.require(:id)
post_id = if params[:flag_topic]
flag_topic = params[:flag_topic]
flag_topic = flag_topic && (flag_topic == true || flag_topic == "true")
post_id = if flag_topic
begin
Topic.find(params[:id]).posts.first.id
rescue