Commit 473d215ef00739226da9e7c3077429c54d912bc1
1 parent
61763a24
Exists in
colab
and in
4 other branches
Improve MetricConfigurationControllers readability
Calling methods with self improve the readability as it makes clear that it is not a variable but a method! Signed off by: Daniel Miranda <danielkza2@gmail.com>
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
app/controllers/base_metric_configurations_controller.rb
| ... | ... | @@ -123,7 +123,7 @@ class BaseMetricConfigurationsController < ApplicationController |
| 123 | 123 | metric = collector.find_metric_by_name(params[:metric_name]) |
| 124 | 124 | end |
| 125 | 125 | |
| 126 | - if !metric.nil? && metric.type == metric_type | |
| 126 | + if !metric.nil? && metric.type == self.metric_type | |
| 127 | 127 | @metric_configuration.metric = metric |
| 128 | 128 | return |
| 129 | 129 | end | ... | ... |
app/controllers/compound_metric_configurations_controller.rb
| ... | ... | @@ -4,7 +4,7 @@ class CompoundMetricConfigurationsController < BaseMetricConfigurationsControlle |
| 4 | 4 | protected |
| 5 | 5 | |
| 6 | 6 | def set_metric! |
| 7 | - @metric_configuration.metric.type = metric_type | |
| 7 | + @metric_configuration.metric.type = self.metric_type | |
| 8 | 8 | end |
| 9 | 9 | |
| 10 | 10 | def metric_configuration_params | ... | ... |