5383: Add back Time.parse(). Without it the value returned would be of the format...
authorRadhika Chippada <radhika@curoverse.com>
Wed, 18 Mar 2015 13:38:26 +0000 (09:38 -0400)
committerRadhika Chippada <radhika@curoverse.com>
Wed, 18 Mar 2015 13:38:26 +0000 (09:38 -0400)
and with Time.parse it would be 2015-03-18 09:37:11 -0400, which is the same as Time.now.

services/api/lib/db_current_time.rb

index 5c97baa66e0a217b178d66cb16c35bc446395ed8..b4a642354626f461e99699fb1203e224bd5122c2 100644 (file)
@@ -2,6 +2,6 @@ module DbCurrentTime
   CURRENT_TIME_SQL = "SELECT clock_timestamp()"
 
   def db_current_time
-    ActiveRecord::Base.connection.select_value(CURRENT_TIME_SQL).to_time
+    Time.parse(ActiveRecord::Base.connection.select_value(CURRENT_TIME_SQL)).to_time
   end
 end