aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/lib/action_web_service
diff options
context:
space:
mode:
authorLeon Breedt <bitserf@gmail.com>2005-03-10 11:53:29 +0000
committerLeon Breedt <bitserf@gmail.com>2005-03-10 11:53:29 +0000
commit4f2f408ba1a7dd976a1ec5061d05ef0439e5f942 (patch)
treed681ffebeda753c1df5450fef68bb298a27f3137 /actionwebservice/lib/action_web_service
parent4e8ca35defa317d22a0b7916f20a4725c235b90c (diff)
downloadrails-4f2f408ba1a7dd976a1ec5061d05ef0439e5f942.tar.gz
rails-4f2f408ba1a7dd976a1ec5061d05ef0439e5f942.tar.bz2
rails-4f2f408ba1a7dd976a1ec5061d05ef0439e5f942.zip
allow 0, 1, '0' or '1' to be cast to the appropriate values for boolean
values. update XML-RPC example to work in :layered mode. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@883 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionwebservice/lib/action_web_service')
-rw-r--r--actionwebservice/lib/action_web_service/vendor/ws/types.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/actionwebservice/lib/action_web_service/vendor/ws/types.rb b/actionwebservice/lib/action_web_service/vendor/ws/types.rb
index 650cdb0848..88098b5bce 100644
--- a/actionwebservice/lib/action_web_service/vendor/ws/types.rb
+++ b/actionwebservice/lib/action_web_service/vendor/ws/types.rb
@@ -146,6 +146,9 @@ module WS
value.to_s
when :bool
return false if value.nil?
+ int_value = Integer(value) rescue nil
+ return true if int_value == 1
+ return false if int_value == 0
value = value.to_s
return true if value == 'true'
return false if value == 'false'