Skip to content

Commit

Permalink
[ec2] fix a race condition around address model instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed May 10, 2010
1 parent 058a358 commit 976e4bd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/fog/aws/models/ec2/address.rb
Expand Up @@ -10,6 +10,12 @@ class Address < Fog::Model

attribute :server_id, 'instanceId'

def initialize(attributes = {})
# assign server first to prevent race condition with new_record?
self.server = attributes.delete(:server)
super
end

def destroy
requires :public_ip

Expand Down

0 comments on commit 976e4bd

Please sign in to comment.