fix test, clientid or campaign.clientid gets you a campaign

This commit is contained in:
Tyrel Souza 2014-04-21 14:52:02 -04:00
parent 6370dcab69
commit 22d789837d

View File

@ -54,7 +54,11 @@ class CampaignsController < ApplicationController
private
def set_campaign
clientid = params[:clientid].to_s.gsub(/\D/, '').to_i
@campaign = Campaign.find_by_clientid(clientid) || Campaign.find_by_clientid(params[:campaign][:clientid]) || not_found
if params[:campaign]
@campaign = Campaign.find_by_clientid(params[:campaign][:clientid]) || not_found
else
@campaign = Campaign.find_by_clientid(clientid) || not_found
end
end
def campaign_params