From 0cb518a3d2d4b5a8489dff1c5cabef4b8097562e Mon Sep 17 00:00:00 2001 From: Paul Thornthwaite Date: Tue, 20 Nov 2012 11:24:10 +0000 Subject: [PATCH] [Brightbox] Fixes Compute#account to pass service When called out of a collection, the `connection` is passed into new models. When created themselves models do not have link back to the service instance (Fog::Compute::Brightbox::Real) causing some actions to fail. --- lib/fog/brightbox/compute.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/fog/brightbox/compute.rb b/lib/fog/brightbox/compute.rb index e5d276846..24c183b68 100644 --- a/lib/fog/brightbox/compute.rb +++ b/lib/fog/brightbox/compute.rb @@ -215,7 +215,10 @@ module Fog # @return [Fog::Compute::Brightbox::Account] # def account - Fog::Compute::Brightbox::Account.new(get_scoped_account) + Fog::Compute::Brightbox::Account.new(get_scoped_account).tap do |acc| + # Connection is more like the compute 'service' + acc.connection = self + end end # Returns true if authentication is being performed as a user