[yast-commit] <rest-service> jr-basemodel : fix generating messages for failed validations (don't use database information)
ref: refs/heads/jr-basemodel commit ad7a15707f59db4682de57744ea9c297f1068927 Author: Josef Reidinger <jreidinger@suse.cz> Date: Mon Dec 14 13:22:30 2009 +0100 fix generating messages for failed validations (don't use database information) --- .../time/app/controllers/systemtime_controller.rb | 4 ++-- webservice/lib/base_model/base.rb | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/plugins/time/app/controllers/systemtime_controller.rb b/plugins/time/app/controllers/systemtime_controller.rb index 2b3e7e2..b6826bf 100644 --- a/plugins/time/app/controllers/systemtime_controller.rb +++ b/plugins/time/app/controllers/systemtime_controller.rb @@ -38,8 +38,8 @@ class SystemtimeController < ApplicationController systemtime = Systemtime.find respond_to do |format| - format.xml { render :xml => systemtime.to_xml( :root => "systemtime", :dasherize => false ) } - format.json { render :json => systemtime.to_json( :root => "systemtime", :dasherize => false ) } + format.xml { render :xml => systemtime.to_xml( :dasherize => false ) } + format.json { render :json => systemtime.to_json( :dasherize => false ) } end end diff --git a/webservice/lib/base_model/base.rb b/webservice/lib/base_model/base.rb index 9ee6252..75ed3a7 100644 --- a/webservice/lib/base_model/base.rb +++ b/webservice/lib/base_model/base.rb @@ -128,5 +128,14 @@ module BaseModel include BaseModel::MassAssignment #serialization of models include BaseModel::Serialization + + end +end +#Hack to properly generate error message without ActiveRecord special methods +module ActiveRecord + class Error + def generate_message(message,options) + message + end end end -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
Josef Reidinger