From 9859ed06b987b4e6f5f814ec3dba815c82af5fad Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Tue, 21 Jan 2014 13:34:26 -0500 Subject: [PATCH] A hack to fix the Claim#messages= hack on 1.8.7. --- lib/fog/rackspace/models/queues/claim.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/fog/rackspace/models/queues/claim.rb b/lib/fog/rackspace/models/queues/claim.rb index c9ebb3787..f1e628a77 100644 --- a/lib/fog/rackspace/models/queues/claim.rb +++ b/lib/fog/rackspace/models/queues/claim.rb @@ -94,6 +94,14 @@ module Fog end end + def initialize(new_attributes = {}) + # A hack in support of the #messages= hack up above. #messages= requires #collection to + # be populated first to succeed, which is always the case in modern Rubies that preserve + # Hash ordering, but not in 1.8.7. + @collection = new_attributes.delete(:collection) + super(new_attributes) + end + private def queue