refer 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1c0b4ef5d6babacbd720f0b0b8ec807d09b5073e26f059978b75ef183e437962
4
- data.tar.gz: 46e08c8caee9dc594535199dac39c55cae05d0dc7b253d9e2918ac9a0fbae201
3
+ metadata.gz: 5695d0df8966228572d9447611c31055e39fb9d18c3f2a8b98cf951efe5db86a
4
+ data.tar.gz: 985bcb344c25e6a78caa7c507bea05b54c8404e674fd1e11c749090482f6cfae
5
5
  SHA512:
6
- metadata.gz: f45a3afc36d2965410d65d47a0b9c3b216ee51f2008a0b4c0836e7236e36d3a949452f31c8aa64be31f2d9073e6eef3138f3e6ca014b3699e7ea2c9984176447
7
- data.tar.gz: 98f214d7321441fdc95b9e01207e0a4aff73435d11b032b28adb40ac20254a3d759f88288e6faa61477ff85014e5374911a922c1e988fef219f9e60a45a3d3d7
6
+ metadata.gz: d04f1b17398ceaf1f6b405d29d5f3e6136caad0438f5bc3b735d167ff41586f4d869bcf04fbcf823b0030de221145cd44263bf72f2834a5aa02fa45c9dc0bb61
7
+ data.tar.gz: 74b1a140b5856cb05fef1ffcbaa51bd1730cc83eee0ca8497c84a2a4bb9d15bd39857549087ba54c198a4e115e72a5e50e20f8677909965a6b05ca0d87bc86e5
@@ -11,7 +11,10 @@ module Refer
11
11
  end
12
12
 
13
13
  def complete!(**attributes)
14
+ return if completed_at?
15
+
14
16
  update attributes.with_defaults(completed_at: Time.current)
17
+ Refer.referral_completed&.call(self)
15
18
  end
16
19
  end
17
20
  end
data/lib/refer/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Refer
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
data/lib/refer.rb CHANGED
@@ -12,6 +12,7 @@ module Refer
12
12
  config_accessor :overwrite_cookie, default: true
13
13
  config_accessor :track_visits, default: true
14
14
  config_accessor :mask_ips, default: true
15
+ config_accessor :referral_completed
15
16
 
16
17
  class Error < StandardError; end
17
18
  class AlreadyReferred < Error; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver