BUGFIX: flag topic broke all liking on the sites
This commit is contained in:
parent
f73a3f252a
commit
5d7a33a799
1 changed files with 4 additions and 1 deletions
|
@ -65,7 +65,10 @@ class PostActionsController < ApplicationController
|
||||||
def fetch_post_from_params
|
def fetch_post_from_params
|
||||||
params.require(:id)
|
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
|
begin
|
||||||
Topic.find(params[:id]).posts.first.id
|
Topic.find(params[:id]).posts.first.id
|
||||||
rescue
|
rescue
|
||||||
|
|
Reference in a new issue