On Thursday 10 September 2009 08:08:45 Klaus Kaempf wrote: > * Martin Vidner <[email protected]> [Sep 09. 2009 18:09]: > > On Wed, Sep 09, 2009 at 10:58:03AM +0200, Jiri Srain wrote: > > > mvidner: > > > - cooperation with Karel > > > > I've pushed what we achieved during yesterday as a branch > > use-activeresource in the client: > > http://git.opensuse.org/?p=projects/yast/web-client.git;a=shortlog;h=refs > >/heads/use-activeresource > > > > It still needs features and refactoring, but it already > > - fixes ActiveResource::Base.find :one (by adding the "else" to the > > "case") - can access /permissions.xml > > while being more readable. > > Can you enlighten us which problem this fixes and some background on > the solution ?
The original YaST::ServiceResource was done to overcome the following limitatons: - ActiveResource not supporting singleton resources (find :one) - Automatic extraction of the path from the interface name - Gathering of resource permissions in order to enable /disable things in the user interface. However, it had a dynamic approach where you ask for the proxy instead of declaring a model class. I think Martin approach is saner and easier for Rails developers. I am not sure how he expects to un-hardcode the remote path prefix by using the interface, but I like the design of declaring the options in the model class itself, in the same style of has_many and so on, one could get something like with_interface "org.yast..." as an option to the path derived from the class. How to do a transition is unknown, but I guess one could use the new class as most resources are still being in / and we can transparently add the instrospection feature later. -- Duncan Mac-Vicar P. - Engineering Manager, YaST SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg) -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
