userlist-rails 0.2.0 → 0.2.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 +13 -1
- data/lib/userlist/rails/company.rb +6 -9
- data/lib/userlist/rails/user.rb +6 -9
- data/lib/userlist/rails/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8b5550e94f954f69d1b8447349a277afb45612c329088a521d7e1f719248d59
|
4
|
+
data.tar.gz: c24fd494b7cf44973a7c1bcb8d472ff8ee2a4672df0d46e1738cdc149f789666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9763a4bdd5fc8c21eef2fd55982f1ebecaafc3ef2a71af497f9e7000f9473aa4ed885a7174ee29919891e57603285aa100704d886489883a2a9cd7f1343c661d
|
7
|
+
data.tar.gz: 81c787f5d451da159443c7d596beab58bb80a264ff05fdd3e4c140a4e8f2e5a114785bde78b32e7397a67d767aab68bcaa2bf6033273853f38e33899b5352813
|
data/README.md
CHANGED
@@ -39,6 +39,18 @@ Userlist.configure do |config|
|
|
39
39
|
end
|
40
40
|
```
|
41
41
|
|
42
|
+
### Disabling in development and test environments
|
43
|
+
|
44
|
+
As sending test and development data into data into Userlist isn't very desireable, you can disable transmissions by setting the push strategy to `:null`.
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
# config/initializer/userlist.rb
|
48
|
+
Userlist.configure do |config|
|
49
|
+
config.push_strategy = :null unless Rails.env.production?
|
50
|
+
end
|
51
|
+
```
|
52
|
+
|
53
|
+
|
42
54
|
## Usage
|
43
55
|
|
44
56
|
### Tracking Users
|
@@ -68,7 +80,7 @@ end
|
|
68
80
|
To manually send user data into Userlist, use the `Userlist::Push.user` method.
|
69
81
|
|
70
82
|
```ruby
|
71
|
-
Userlist::Push.
|
83
|
+
Userlist::Push.user(identifier: user.id, email: user.email, properties: { first_name: user.first_name, last_name: user.last_name })
|
72
84
|
```
|
73
85
|
|
74
86
|
### Tracking Events
|
@@ -7,15 +7,8 @@ module Userlist
|
|
7
7
|
extend ActiveSupport::Concern
|
8
8
|
|
9
9
|
included do
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
if respond_to?(:after_commit)
|
15
|
-
after_commit(&block)
|
16
|
-
elsif respond_to?(:after_save)
|
17
|
-
after_save(&block)
|
18
|
-
end
|
10
|
+
method = [:after_commit, :after_save].find { |m| respond_to?(m) }
|
11
|
+
public_send(method, :userlist_push) if method
|
19
12
|
end
|
20
13
|
|
21
14
|
def userlist_identifier
|
@@ -37,6 +30,10 @@ module Userlist
|
|
37
30
|
def userlist_name
|
38
31
|
return name if respond_to?(:name)
|
39
32
|
end
|
33
|
+
|
34
|
+
def userlist_push
|
35
|
+
Userlist::Push.company(userlist_payload)
|
36
|
+
end
|
40
37
|
end
|
41
38
|
end
|
42
39
|
end
|
data/lib/userlist/rails/user.rb
CHANGED
@@ -7,15 +7,8 @@ module Userlist
|
|
7
7
|
extend ActiveSupport::Concern
|
8
8
|
|
9
9
|
included do
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
if respond_to?(:after_commit)
|
15
|
-
after_commit(&block)
|
16
|
-
elsif respond_to?(:after_save)
|
17
|
-
after_save(&block)
|
18
|
-
end
|
10
|
+
method = [:after_commit, :after_save].find { |m| respond_to?(m) }
|
11
|
+
public_send(method, :userlist_push) if method
|
19
12
|
end
|
20
13
|
|
21
14
|
def userlist_identifier
|
@@ -43,6 +36,10 @@ module Userlist
|
|
43
36
|
signed_up_at: created_at
|
44
37
|
}
|
45
38
|
end
|
39
|
+
|
40
|
+
def userlist_push
|
41
|
+
Userlist::Push.user(userlist_payload)
|
42
|
+
end
|
46
43
|
end
|
47
44
|
end
|
48
45
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: userlist-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benedikt Deicke
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -172,8 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
|
-
|
176
|
-
rubygems_version: 2.7.3
|
175
|
+
rubygems_version: 3.0.3
|
177
176
|
signing_key:
|
178
177
|
specification_version: 4
|
179
178
|
summary: Rails integration for Userlist.io
|