referthis 0.4.13 → 0.4.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/referral.rb +2 -10
  2. metadata +2 -2
data/lib/referral.rb CHANGED
@@ -17,22 +17,14 @@ class Referral < ActiveRecord::Base
17
17
  if endpoints[:phone_number] != ''
18
18
  threads << Thread.new('sms'){
19
19
  phone_number = SMS.sieve(endpoints[:phone_number])
20
- if Referee.exists?(:endpoint => phone_number)
21
- SMS.send_referral(self.construct(Referee.find_by_endpoint(phone_number.to_s).id), url, referrer_name, app_name)
22
- else
23
- SMS.send_referral(self.construct(Referee.construct(phone_number.to_s).id), url, referrer_name, app_name)
24
- end
20
+ Referee.exists?(:endpoint => phone_number) ? SMS.send_referral(self.construct(Referee.find_by_endpoint(phone_number.to_s).id), url, referrer_name, app_name) : SMS.send_referral(self.construct(Referee.construct(phone_number.to_s).id), url, referrer_name, app_name)
25
21
  }
26
22
  end
27
23
  if endpoints[:email_address] != ''
28
24
  threads << Thread.new('email'){
29
25
  email_address = endpoints[:email_address]
30
26
  begin
31
- if Referee.exists?(:endpoint => email_address)
32
- Mailer.send_referral(self.construct(Referee.find_by_endpoint(email_address).id), url, referrer_name, app_name).deliver
33
- else
34
- Mailer.send_referral(self.construct(Referee.construct(email_address).id), url, referrer_name, app_name).deliver
35
- end
27
+ Referee.exists?(:endpoint => email_address) ? Mailer.send_referral(self.construct(Referee.find_by_endpoint(email_address).id), url, referrer_name, app_name).deliver : Mailer.send_referral(self.construct(Referee.construct(email_address).id), url, referrer_name, app_name).deliver
36
28
  rescue Net::SMTPSyntaxError
37
29
  puts 'Hello'
38
30
  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.4.13
4
+ version: 0.4.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-03 00:00:00.000000000 Z
12
+ date: 2012-07-05 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: