FIX: clicks counter on attachments wasn't always working

This commit is contained in:
Régis Hanol
2015-02-22 20:47:18 +01:00
parent a2d9e4cf97
commit 20c9a312c7
7 changed files with 70 additions and 75 deletions

View File

@ -8,12 +8,6 @@ class ClicksController < ApplicationController
if params[:topic_id].present? || params[:post_id].present?
params.merge!({ user_id: current_user.id }) if current_user.present?
@redirect_url = TopicLinkClick.create_from(params)
if @redirect_url.blank? && params[:url].index('?')
# Check the url without query parameters
params[:url].sub!(/\?.*$/, '')
@redirect_url = TopicLinkClick.create_from(params)
end
end
# Sometimes we want to record a link without a 302. Since XHR has to load the redirected