Mailinglist Archive: opensuse-ruby (15 mails)

< Previous Next >
[opensuse-ruby] Webyast: ancestor for models in rest-service merged to master
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Mon, 14 Dec 2009 16:45:28 +0100
  • Message-id: <200912141645.28738.jreidinger@xxxxxxx>
I implement ancestor which have some usable utilities for rest-service models.
Reason to have it is in bug
I call it BaseModel and it is inspired by ActiveModel from rails3.0. It is
general usability and I think that all models which is not based on database
or REST service could benefit from it. ( just inform me, I can help you to use
it in your project).
Main features is:
* callbacks (before_save etc.)
* validations ( validates_format_of etc.)
* serialization ( to_xml and to_json and also restore it)
* mass assignment (load instance from hash, also whitelisting and blacklisting
attributes for mass assignment).
For details see documentation:
i586/javadoc/webservice/index.html classes in BaseModel namespace (sorry
internal only, as we still doesn't have public place where we synchronize
documentation ). Or you can generate it in git by rake doc:app in webservice
For example usage see time plugin, which use validations, after_save hook,
mass assignment and also serialization ( It is also example of xml limitation
as for hash is key used as tags and tags is quite restricted, so time module
must transform hash before serialization ).

Welcome your comments, suggestions or ideas what could be improved or added (
especially if more then one plugin could benefit from it).
Josef Reidinger
YaST team
maintainer of perl-Bootloader, YaST2-Repair, webyast
To unsubscribe, e-mail: opensuse-ruby+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-ruby+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages