Commit ed0bfc149c78ff52ce79a9bd02cb39e95b8a5c46
Committed by
Paulo Meireles
1 parent
c9898c9f
Exists in
master
and in
28 other branches
[Mezuro] Fixed to_hash from metric_configuration to work without parameters
Showing
2 changed files
with
6 additions
and
3 deletions
Show diff stats
plugins/mezuro/lib/kalibro/metric_configuration.rb
| ... | ... | @@ -51,7 +51,7 @@ class Kalibro::MetricConfiguration < Kalibro::Model |
| 51 | 51 | def save |
| 52 | 52 | begin |
| 53 | 53 | self.class.request("MetricConfiguration", :save_metric_configuration, { |
| 54 | - :metric_configuration => to_hash(:except => [:configuration_name]), | |
| 54 | + :metric_configuration => to_hash, | |
| 55 | 55 | :configuration_name => configuration_name}) |
| 56 | 56 | true |
| 57 | 57 | rescue Exception => error |
| ... | ... | @@ -65,7 +65,10 @@ class Kalibro::MetricConfiguration < Kalibro::Model |
| 65 | 65 | :metric_name=> metric.name |
| 66 | 66 | }) |
| 67 | 67 | end |
| 68 | - | |
| 68 | + | |
| 69 | + def to_hash | |
| 70 | + super :except => [:configuration_name] | |
| 71 | + end | |
| 69 | 72 | |
| 70 | 73 | private |
| 71 | 74 | ... | ... |
plugins/mezuro/test/unit/kalibro/metric_configuration_test.rb
| ... | ... | @@ -19,7 +19,7 @@ class MetricConfigurationTest < ActiveSupport::TestCase |
| 19 | 19 | end |
| 20 | 20 | |
| 21 | 21 | should 'convert metric configuration to hash' do |
| 22 | - assert_equal @native_metric_configuration_hash, @native_metric_configuration.to_hash(:except => [:configuration_name]) | |
| 22 | + assert_equal @native_metric_configuration_hash, @native_metric_configuration.to_hash() | |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | 25 | should 'create appropriate metric type' do | ... | ... |