Commit ed0bfc149c78ff52ce79a9bd02cb39e95b8a5c46

Authored by Alessandro Palmeira + Caio Salgado
Committed by Paulo Meireles
1 parent c9898c9f

[Mezuro] Fixed to_hash from metric_configuration to work without parameters

plugins/mezuro/lib/kalibro/metric_configuration.rb
@@ -51,7 +51,7 @@ class Kalibro::MetricConfiguration < Kalibro::Model @@ -51,7 +51,7 @@ class Kalibro::MetricConfiguration < Kalibro::Model
51 def save 51 def save
52 begin 52 begin
53 self.class.request("MetricConfiguration", :save_metric_configuration, { 53 self.class.request("MetricConfiguration", :save_metric_configuration, {
54 - :metric_configuration => to_hash(:except => [:configuration_name]), 54 + :metric_configuration => to_hash,
55 :configuration_name => configuration_name}) 55 :configuration_name => configuration_name})
56 true 56 true
57 rescue Exception => error 57 rescue Exception => error
@@ -65,7 +65,10 @@ class Kalibro::MetricConfiguration < Kalibro::Model @@ -65,7 +65,10 @@ class Kalibro::MetricConfiguration < Kalibro::Model
65 :metric_name=> metric.name 65 :metric_name=> metric.name
66 }) 66 })
67 end 67 end
68 - 68 +
  69 + def to_hash
  70 + super :except => [:configuration_name]
  71 + end
69 72
70 private 73 private
71 74
plugins/mezuro/test/unit/kalibro/metric_configuration_test.rb
@@ -19,7 +19,7 @@ class MetricConfigurationTest < ActiveSupport::TestCase @@ -19,7 +19,7 @@ class MetricConfigurationTest < ActiveSupport::TestCase
19 end 19 end
20 20
21 should 'convert metric configuration to hash' do 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 end 23 end
24 24
25 should 'create appropriate metric type' do 25 should 'create appropriate metric type' do