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: 50d0d14a13b70076ddc6ee6ccad248e73dfd50eff8098c05afdb704f7f3be560
4
- data.tar.gz: b4c0597894d8b9ebea7e37c4d6173038e4185b015714e933be5e63372a3576c8
3
+ metadata.gz: d37bbb54fd9df63a3755c6920737ffcd50e97aa6d5d5432714565c4f56061bfa
4
+ data.tar.gz: aee325f78b12060afd4007459219e81f239bcd5d8a62b131776bc87163567f60
5
5
  SHA512:
6
- metadata.gz: 941b67d25a355a18af7c7fc14b009d56ebb4aa004282984c3db06f542d35b4cdbd36772a60d3be3ff4567e7fbcace7a8b04782b78765dd6f4270632e60634062
7
- data.tar.gz: 531f9780f79c4fa0b27b99b939776cf1b499bb97f9fb3de74ed89f6b33d9cd61622e1765b10edc0f6c2f0897e6c80f784262ba2a4b16dd1042df3924ead8cbf6
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.class.ranges.any? %>
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
@@ -1,3 +1,3 @@
1
1
  module Metricky
2
- VERSION = '0.7.1'
2
+ VERSION = '0.7.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metricky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Brody