lib/fog/rackspace/models/identity/user.rb in fog-maestrodev-1.7.0.20121114190951 vs lib/fog/rackspace/models/identity/user.rb in fog-maestrodev-1.8.0.20130109172219
- old
+ new
@@ -13,37 +13,37 @@
attribute :created
attribute :updated
def save
requires :username, :email, :enabled
- if identity.nil?
- data = connection.create_user(username, email, enabled, :password => password)
+ unless persisted?
+ data = service.create_user(username, email, enabled, :password => password)
else
- data = connection.update_user(identity, username, email, enabled, :password => password)
+ data = service.update_user(identity, username, email, enabled, :password => password)
end
merge_attributes(data.body['user'])
true
end
def destroy
requires :identity
- connection.delete_user(identity)
+ service.delete_user(identity)
true
end
def roles
@roles ||= begin
Fog::Rackspace::Identity::Roles.new({
- :connection => connection,
+ :service => service,
:user => self
})
end
end
def credentials
@credentials ||= begin
Fog::Rackspace::Identity::Credentials.new({
- :connection => connection,
+ :service => service,
:user => self
})
end
end
end