broken_window 1.1.0 → 1.1.1

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
  SHA1:
3
- metadata.gz: 4f486568923c0240a670406f6f39d43106de773f
4
- data.tar.gz: c8bc0696766613a6c62aca487087c928e3eb8855
3
+ metadata.gz: 11c0ac67070aedeea672f653f63f0506b83d963b
4
+ data.tar.gz: f63baf850225e94257c33ec1932fbbed0b88253a
5
5
  SHA512:
6
- metadata.gz: 62b0209d894eb0d4108689842ac8386673f4905f1f91037b476bb50f092be9b79255c18c4f15704f25df4dea5c87031e6532a24d084bd3143e2adc17533c60e5
7
- data.tar.gz: 7a846fb8f52c16f81cb0ff83738bfd93d638af2de767e2ba50b2e1c6f1e95b9e85e050067763e4f93d0471ecadb0947589b33e767ef5935c9ea318b4bb5c6850
6
+ metadata.gz: 8c906f2bfafdf3df22d1e7f73e081a102f5b3280fccf486712e5b7fada09cbfa3db9beaa3ed617b5680deb24dd3d462ed9f30d14f0850e45ffa1a18010ac3ed6
7
+ data.tar.gz: 139dba92f5723debe8f16b221cdda5ab1d7c19a78087b476c10d0fcd11286df804525bfa8390bc43828f1b87fc205746fc4d4c552926115db872ba4f6aa85eb7
@@ -1,4 +1,11 @@
1
1
  module BrokenWindow
2
2
  module ApplicationHelper
3
+ def up_path(metric)
4
+ if metric.parent
5
+ metric_path metric.parent
6
+ else
7
+ metrics_path
8
+ end
9
+ end
3
10
  end
4
11
  end
@@ -38,7 +38,7 @@ module BrokenWindow
38
38
  metric
39
39
  end
40
40
 
41
- delegate :name, :to_param, :threshold, :value_type, :threshold_type, :container?, to: :metric
41
+ delegate :name, :to_param, :threshold, :value_type, :threshold_type, :parent, :container?, to: :metric
42
42
  delegate :value, to: :measurement, allow_nil: true
43
43
 
44
44
  private
@@ -4,7 +4,7 @@ module BrokenWindow
4
4
 
5
5
  def call
6
6
  Metric.all.each do |metric|
7
- MetricMeasurer.call(metric)
7
+ MetricMeasurer.call(metric) unless metric.container?
8
8
  end
9
9
  end
10
10
  end
@@ -18,7 +18,7 @@ module BrokenWindow
18
18
  end
19
19
 
20
20
  def calculator_class
21
- raise ArgumentError unless @metric.calculator
21
+ raise ArgumentError.new("No calculator for #{@metric.inspect}") unless @metric.calculator.present?
22
22
 
23
23
  @metric.calculator.constantize
24
24
  end
@@ -1,4 +1,4 @@
1
- <%= link_to '', metrics_path, class: 'back-link fa fa-level-up' %>
1
+ <%= link_to '', up_path(@metric), class: 'back-link fa fa-level-up' %>
2
2
 
3
3
  <div class="show-metric">
4
4
  <h1><%= @metric.name %></h1>
@@ -1,3 +1,3 @@
1
1
  module BrokenWindow
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: broken_window
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Craig Ambrose