scoutmetrics 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/scoutmetrics/user.rb +13 -1
- data/scoutmetrics.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e01ec1b200b04f4e59bd8bb9a5e44492f35f81f
|
4
|
+
data.tar.gz: e00487b20d11a68e0ceceed4ddb27f67cc38ca1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87a61f8a9af8cc3de83f442922dbe7d01fd310acf6bf7838deb88729d5557fb6895a2cc4d8b8aa79d705c744a378ff8b2740b17322e7bebc77e337fd9c068521
|
7
|
+
data.tar.gz: 9fb7abeb29a35ba8d1546dd5bc6127914807c147f6a6965bf6acf7fd757dcc977841be8194fec69a7107eb39238e4bbb985f3309632cdb2c706509632ca48829
|
data/lib/scoutmetrics/user.rb
CHANGED
@@ -18,7 +18,11 @@ module ScoutMetrics
|
|
18
18
|
|
19
19
|
# Override save method to post the information to Scout Metrics
|
20
20
|
def save
|
21
|
-
|
21
|
+
params = {}
|
22
|
+
params[:signup_date] = signup_date if field_present?(signup_date)
|
23
|
+
params[:return_date] = return_date if field_present?(return_date)
|
24
|
+
params[:active] = active if field_present?(active)
|
25
|
+
post_update(id, params)
|
22
26
|
end
|
23
27
|
|
24
28
|
# Posts signup date for this user (if it doesn't exist yet the "AppUser" will be created)
|
@@ -48,6 +52,14 @@ module ScoutMetrics
|
|
48
52
|
|
49
53
|
private
|
50
54
|
|
55
|
+
def field_blank?(field)
|
56
|
+
field.nil? || field.empty?
|
57
|
+
end
|
58
|
+
|
59
|
+
def field_present?(field)
|
60
|
+
!field_blank?(field)
|
61
|
+
end
|
62
|
+
|
51
63
|
# @return [Json] Returns a msg for the transaction and the status of the request
|
52
64
|
# @return msg explanation of outcome
|
53
65
|
def post_update(id, params)
|
data/scoutmetrics.gemspec
CHANGED