Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <web-client> use-activeresource : no comment
  • From: Martin Kudlvasr <mkudlvasr@xxxxxxx>
  • Date: Wed, 16 Sep 2009 15:01:44 +0200
  • Message-id: <E1MoJ2a-0003QJ-2c@xxxxxxxxxxxxxxxx>
ref: refs/heads/use-activeresource
commit 45fad0d7ce40689251379d298b21b70e8f25130f
Author: Martin Kudlvasr <mkudlvasr@xxxxxxx>
Date: Wed Sep 16 15:01:44 2009 +0200

no comment
---
plugins/network/app/models/yast_resource.rb | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/plugins/network/app/models/yast_resource.rb
b/plugins/network/app/models/yast_resource.rb
index be45496..1d1c7f6 100644
--- a/plugins/network/app/models/yast_resource.rb
+++ b/plugins/network/app/models/yast_resource.rb
@@ -1,7 +1,5 @@
# Replacement for YaST::ServiceResource
# FIXME capitalize properly "YaSTResource"
-require 'interface_resource'
-
class String
def rsplit(*args)
splited = self.reverse.split(*args)
@@ -28,10 +26,13 @@ class YastResource < ActiveResource::Base
@interface = interface.tr('.','-')
end

- def self.find_interface
- resource = InterfaceResource.find(@interface.tr('.','-'))
- if resource.implementations.empty? raise "Cannot find resource for
interface #{@interface}"
- self.prefix, self.collection_name =
resource.implementations.first.rsplit("/",2)
+ def self.initialize_from_interface
+ resources = InterfaceResource.find(@interface.tr('.','-'))
+ if resources.empty? then raise "Cannot find resource for interface
#{@interface}" end
+ resource = resources.first
+ self.prefix, self.collection_name = resource.controller.rsplit("/",2)
+ self.has_policy resource.policy
+ if resource.singular then self.is_singular_resource end
end


--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages