referthis 0.4.10 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/referral.rb +3 -3
- metadata +1 -1
data/lib/referral.rb
CHANGED
@@ -63,13 +63,13 @@ class Referral < ActiveRecord::Base
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
end
|
66
|
-
clicked_through_rate['email'] = ((clicked_through_email.to_f / count_email.to_f) * 100)
|
67
|
-
clicked_through_rate['sms'] = ((clicked_through_sms.to_f / count_sms.to_f) * 100)
|
66
|
+
clicked_through_rate['email'] = ((clicked_through_email.to_f / count_email.to_f) * 100) if email
|
67
|
+
clicked_through_rate['sms'] = ((clicked_through_sms.to_f / count_sms.to_f) * 100) if sms
|
68
68
|
else
|
69
69
|
return '0%'
|
70
70
|
end
|
71
71
|
end
|
72
|
-
clicked_through_rate['overall'] = ((Referral.where('visits > 0').count.to_f / Referral.count.to_f) * 100)
|
72
|
+
clicked_through_rate['overall'] = ((Referral.where('visits > 0').count.to_f / Referral.count.to_f) * 100) if overall
|
73
73
|
return clicked_through_rate
|
74
74
|
end
|
75
75
|
def self.resolve_token(token)
|