From d9792bb1f58eefe44d01b6ca3ade5249a5e234f3 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Wed, 31 Aug 2011 17:00:19 +0200 Subject: [PATCH] feature #720: Fix ruby 1.9 problem in watch_client --- src/acct/watch_client.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/acct/watch_client.rb b/src/acct/watch_client.rb index 6f65d07b48..1b1feb6a5c 100644 --- a/src/acct/watch_client.rb +++ b/src/acct/watch_client.rb @@ -98,14 +98,14 @@ module OneWatchClient max_per_vm = rsql. group(:id, :last_poll). - select(:last_poll, :MAX[mr.to_sym].as(:max_mr)) + select{[:last_poll, max(mr.to_sym).as(:max_mr)]} # SUM the monitoring resource for each last_poll value last_poll_and_sum = max_per_vm. from_self. group(:last_poll). - select(:last_poll, :SUM[:max_mr].as(:sum_mr)) + select{[:last_poll, sum(:max_mr).as(:sum_mr)]} # Retrieve the information in an Array a = Array.new @@ -113,7 +113,7 @@ module OneWatchClient if row[:last_poll] && row[:last_poll] != 0 a << [row[:last_poll], row[:sum_mr].to_i] end - end + end a end @@ -229,4 +229,4 @@ module OneWatchClient end end end -end \ No newline at end of file +end