metricky 0.7.1 → 0.7.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d37bbb54fd9df63a3755c6920737ffcd50e97aa6d5d5432714565c4f56061bfa
|
4
|
+
data.tar.gz: aee325f78b12060afd4007459219e81f239bcd5d8a62b131776bc87163567f60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0c535d00a7d96a71ceb91acce1d221749294129fea6e2a222bef30cd5636a620c61bf53896f6c16d07828c25a39315818a27b0c8b26855a39d339017ad5780b
|
7
|
+
data.tar.gz: 5ec007df44b35ca3181fea326b80fbc6f9464659c607c5d59ab6288ded8efde2228e45a1d7ae62b162f3f2248bfb0d72449618d4e142a3c58989758aac3e5d9f
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<div>
|
5
5
|
<h5><%= metric.title %></h5>
|
6
6
|
</div>
|
7
|
-
<% if metric.
|
7
|
+
<% if metric.form? %>
|
8
8
|
<div>
|
9
9
|
<%= f.select :range, metric.range_collection, { selected: metric.range }, { class: "form-control-sm", name: "#{metric.form_name}[range]", onchange: "this.form.submit()" } %>
|
10
10
|
</div>
|
@@ -36,5 +36,11 @@ class <%= class_name %>Metric < ApplicationMetric
|
|
36
36
|
# ==> Remove ranges
|
37
37
|
# Remove ranges from the select
|
38
38
|
# exclude_ranges '24h', '30d'
|
39
|
+
|
40
|
+
# ==> Disable the form
|
41
|
+
# Display the form if you have a metric that doesn't need to be queried (e.g. average user age of all users)
|
42
|
+
# def form?
|
43
|
+
# false
|
44
|
+
# end
|
39
45
|
end
|
40
46
|
<% end -%>
|
data/lib/metricky/base.rb
CHANGED
@@ -98,6 +98,11 @@ module Metricky
|
|
98
98
|
@query
|
99
99
|
end
|
100
100
|
|
101
|
+
# If you have a static metric that doesn't need to be queried (e.g. average users age of all users), disable the form
|
102
|
+
def form?
|
103
|
+
true
|
104
|
+
end
|
105
|
+
|
101
106
|
def valid_type?
|
102
107
|
VALID_TYPES.include?(type.to_sym)
|
103
108
|
end
|
data/lib/metricky/version.rb
CHANGED