lib/fog/rackspace/models/queues/claim.rb in fog-maestrodev-1.19.0.20140212012611 vs lib/fog/rackspace/models/queues/claim.rb in fog-maestrodev-1.20.0.20140305101305

- old
+ new

@@ -92,10 +92,18 @@ ) end 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 collection.queue end @@ -107,10 +115,10 @@ options[:limit] = limit unless limit.nil? response = service.create_claim(queue.identity, ttl, grace, options) if [200, 201].include? response.status - self.identity = response.headers['Location'].split('/').last + self.identity = response.get_header('Location').split('/').last self.messages = response.body #Since Claims aren't a server side collection, we need to # add the claim to the collection collection << self