referthis 0.3.42 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/referral.rb +2 -2
  2. data/lib/referthis.rb +1 -1
  3. metadata +1 -1
data/lib/referral.rb CHANGED
@@ -40,7 +40,7 @@ class Referral < ActiveRecord::Base
40
40
  end
41
41
  threads.each {|thread| thread.join}
42
42
  end
43
- def self.percent_clicked_through(email=nil, sms=nil)
43
+ def self.clicked_through_stat(email=false, sms=false, overall=true)
44
44
  if email || sms
45
45
  referrals = Referral.all
46
46
  if referrals.any?
@@ -64,11 +64,11 @@ class Referral < ActiveRecord::Base
64
64
  end
65
65
  puts ((clicked_through_email.to_f / count_email.to_f) * 100).to_s + '%' if email
66
66
  puts ((clicked_through_sms.to_f / count_sms.to_f) * 100).to_s + '%' if sms
67
- puts ((Referral.where('visits > 0').count.to_f / Referral.count.to_f) * 100).to_s + '%'
68
67
  else
69
68
  puts '0%'
70
69
  end
71
70
  end
71
+ puts ((Referral.where('visits > 0').count.to_f / Referral.count.to_f) * 100).to_s + '%' if overall
72
72
  end
73
73
  def self.resolve_token(token)
74
74
  referral_id = Base64::decode64(token)
data/lib/referthis.rb CHANGED
@@ -10,7 +10,7 @@ class ReferThis < Referral
10
10
  system('cp -r ' + File.dirname(File.absolute_path(__FILE__)) + '/db/migrate/* ' + "'" + Rails.root.to_s.split('app/').first + "/db/migrate/'")
11
11
  system('rake db:migrate')
12
12
  end
13
- def self.url(endpoints, user_current_id, url, referrer_name, app_name=Rails.application.class.to_s.split("::").first)
13
+ def self.url(endpoints, user_current_id, url, referrer_name, app_name=Rails.application.class.to_s.split('::').first)
14
14
  self.generate_referral(endpoints, user_current_id, url, referrer_name, app_name)
15
15
  end
16
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: referthis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.42
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: