refer 0.4.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/models/refer/referral.rb +3 -0
- data/lib/refer/engine.rb +10 -0
- data/lib/refer/version.rb +1 -1
- data/lib/refer.rb +4 -8
- metadata +5 -5
- /data/{app/models/concerns → lib}/refer/has_referrals.rb +0 -0
- /data/{app/models/concerns → lib}/refer/model.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26dec8b5edf5b8021afc74684efb620ec85d17742e37e10f5f64a9d32eb964a0
|
4
|
+
data.tar.gz: bd63be068604abc052e4160a66fdaf8b53da9d34f9f3f959e557a039e1bdd16d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 503cb89b559261eeafe9cddb7de4352d2bff3d5677b72b5950a92f6dcb115066a9d0ab6def4bfb1bf9fe9bd40a08ad828b0b0082bcf48d7ec049786cdf5ad5db
|
7
|
+
data.tar.gz: dae9b637b0666ccc4468e015b622b00094b804eff8aa2ef895938f16e7be4d1dc0fee95284915a5b8fb0a015ac6f1a4413b6b06cc663abdc79382c6fe7d426a7
|
data/README.md
CHANGED
@@ -27,7 +27,7 @@ bin/rails db:migrate
|
|
27
27
|
|
28
28
|
## 🧑💻 Usage
|
29
29
|
|
30
|
-
Refer adds a
|
30
|
+
Refer adds a model to your Rails application for tracking referrals and referral codes.
|
31
31
|
|
32
32
|
To track referrals, you'll need to
|
33
33
|
|
data/lib/refer/engine.rb
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
module Refer
|
2
2
|
class Engine < ::Rails::Engine
|
3
3
|
isolate_namespace Refer
|
4
|
+
|
5
|
+
initializer "refer.hooks" do
|
6
|
+
ActiveSupport.on_load(:active_record) do
|
7
|
+
include Refer::HasReferrals
|
8
|
+
end
|
9
|
+
|
10
|
+
ActiveSupport.on_load(:action_controller) do
|
11
|
+
include Refer::Controller
|
12
|
+
end
|
13
|
+
end
|
4
14
|
end
|
5
15
|
end
|
data/lib/refer/version.rb
CHANGED
data/lib/refer.rb
CHANGED
@@ -5,6 +5,9 @@ require "securerandom"
|
|
5
5
|
module Refer
|
6
6
|
include ActiveSupport::Configurable
|
7
7
|
|
8
|
+
autoload :HasReferrals, "refer/has_referrals"
|
9
|
+
autoload :Model, "refer/model"
|
10
|
+
|
8
11
|
config_accessor :code_generator, default: ->(referrer) { SecureRandom.alphanumeric(8) }
|
9
12
|
config_accessor :cookie_length, default: 30.days
|
10
13
|
config_accessor :cookie_name, default: :refer_code
|
@@ -12,6 +15,7 @@ module Refer
|
|
12
15
|
config_accessor :overwrite_cookie, default: true
|
13
16
|
config_accessor :track_visits, default: true
|
14
17
|
config_accessor :mask_ips, default: true
|
18
|
+
config_accessor :referral_completed
|
15
19
|
|
16
20
|
class Error < StandardError; end
|
17
21
|
class AlreadyReferred < Error; end
|
@@ -52,12 +56,4 @@ module Refer
|
|
52
56
|
end
|
53
57
|
end
|
54
58
|
|
55
|
-
ActiveSupport.on_load(:active_record) do
|
56
|
-
include Refer::HasReferrals
|
57
|
-
end
|
58
|
-
|
59
|
-
ActiveSupport.on_load(:action_controller) do
|
60
|
-
include Refer::Controller
|
61
|
-
end
|
62
|
-
|
63
59
|
ActiveSupport.run_load_hooks(:refer, Refer)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Oliver
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -35,8 +35,6 @@ files:
|
|
35
35
|
- README.md
|
36
36
|
- Rakefile
|
37
37
|
- app/controllers/concerns/refer/controller.rb
|
38
|
-
- app/models/concerns/refer/has_referrals.rb
|
39
|
-
- app/models/concerns/refer/model.rb
|
40
38
|
- app/models/refer/application_record.rb
|
41
39
|
- app/models/refer/referral.rb
|
42
40
|
- app/models/refer/referral_code.rb
|
@@ -51,6 +49,8 @@ files:
|
|
51
49
|
- lib/generators/refer/model/model_generator.rb
|
52
50
|
- lib/refer.rb
|
53
51
|
- lib/refer/engine.rb
|
52
|
+
- lib/refer/has_referrals.rb
|
53
|
+
- lib/refer/model.rb
|
54
54
|
- lib/refer/version.rb
|
55
55
|
- lib/tasks/refer_tasks.rake
|
56
56
|
homepage: https://github.com/excid3/refer
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
|
-
rubygems_version: 3.5.
|
78
|
+
rubygems_version: 3.5.13
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: Referral codes & affiliate links for Ruby on Rails apps
|
File without changes
|
File without changes
|