ref: refs/heads/master
commit a35b2943715ad0a4026a1f961b9a6e430fd21916
Author: Jiri Suchomel
Date: Thu Aug 6 12:58:07 2009 +0200
fixed what stopped working after refactoring
---
plugins/users/app/controllers/users_controller.rb | 2 --
plugins/users/app/models/user.rb | 13 ++++++-------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/plugins/users/app/controllers/users_controller.rb b/plugins/users/app/controllers/users_controller.rb
index 0e3d4e2..8d01db1 100644
--- a/plugins/users/app/controllers/users_controller.rb
+++ b/plugins/users/app/controllers/users_controller.rb
@@ -1,5 +1,3 @@
-# import YastService class FIXME move into the model...
-
include ApplicationHelper
class UsersController < ApplicationController
diff --git a/plugins/users/app/models/user.rb b/plugins/users/app/models/user.rb
index 8a0396f..568503d 100644
--- a/plugins/users/app/models/user.rb
+++ b/plugins/users/app/models/user.rb
@@ -1,4 +1,3 @@
-
require 'yast_service'
# User model, not ActiveRecord based, but a
@@ -58,8 +57,9 @@ class User
raise "Got no data while loading user attributes" if user_map.empty?
- load_data(user_map)
+ user.load_data(user_map)
user.uid = id
+ user
end
# User.destroy("joe")
@@ -71,8 +71,8 @@ class User
}
ret = YastService.Call("YaPI::USERS::UserDelete", config)
- Rails.logger "Command returns: #{ret}"
- # @error_string = ret
+ Rails.logger.debug "Command returns: #{ret}"
+ raise ret if not ret.blank?
return (ret == "")
end
@@ -88,7 +88,7 @@ class User
data = retrieve_data
ret = YastService.Call("YaPI::USERS::UserModify", config, data)
- logger.debug "Command returns: #{ret.inspect}"
+ Rails.logger.debug "Command returns: #{ret.inspect}"
raise ret if not ret.blank?
true
end
@@ -100,7 +100,7 @@ class User
data.each do |key, value|
attrs.store(key.underscore, value)
end
- load_attribures(attrs)
+ load_attributes(attrs)
end
# load a hash of attributes
@@ -140,7 +140,6 @@ class User
ret = YastService.Call("YaPI::USERS::UserAdd", config, data)
Rails.logger.debug "Command returns: #{ret.inspect}"
- # @error_string = ret
raise ret if not ret.blank?
user
end
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org