Mailinglist Archive: yast-devel (128 mails)

< Previous Next >
[yast-devel] How to avoid sending nil to dbus
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Fri, 12 Feb 2010 11:41:44 +0100
  • Message-id: <201002121141.45162.jreidinger@xxxxxxx>
Hi,
few bugs in last few days contain problem with sending nil to DBus which crash.
Easy way to solve it is to use validations. In restService is BaseModel[1]
which povides validation. Usage is same as for ActiveRecord validations [2].
For inspiration how it could look like you can look at time model [3] (I allow
nil in validation but then handle it, but if sending empty value doesn't make
sense you can force non-nil).
Feel free to ask questions.
Josef

[1]
http://svn.opensuse.org/autodocs/webyast-service/head/webservice/classes/BaseModel/Base.html
[2] http://ar.rubyonrails.org/classes/ActiveRecord/Validations/ClassMethods.html
[3]
http://gitorious.org/opensuse/yast-rest-service/blobs/master/plugins/time/app/models/systemtime.rb
--
Josef Reidinger
YaST team
maintainer of perl-Bootloader, YaST2-Repair, parts of webyast
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages