referthis 0.4.11 → 0.4.12
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/referral.rb +2 -2
- metadata +1 -1
data/lib/referral.rb
CHANGED
@@ -41,7 +41,7 @@ class Referral < ActiveRecord::Base
|
|
41
41
|
threads.each {|thread| thread.join}
|
42
42
|
end
|
43
43
|
def self.clicked_through_rate(email=false, sms=false, overall=true)
|
44
|
-
clicked_through_rate =
|
44
|
+
clicked_through_rate = Hash.new
|
45
45
|
if email || sms
|
46
46
|
referrals = Referral.all
|
47
47
|
if referrals.any?
|
@@ -66,7 +66,7 @@ class Referral < ActiveRecord::Base
|
|
66
66
|
clicked_through_rate['email'] = ((clicked_through_email.to_f / count_email.to_f) * 100) if email
|
67
67
|
clicked_through_rate['sms'] = ((clicked_through_sms.to_f / count_sms.to_f) * 100) if sms
|
68
68
|
else
|
69
|
-
return '0
|
69
|
+
return '0'
|
70
70
|
end
|
71
71
|
end
|
72
72
|
clicked_through_rate['overall'] = ((Referral.where('visits > 0').count.to_f / Referral.count.to_f) * 100) if overall
|