From 8032c4ffd47ba4deb5cbd88a462b837240eb593c Mon Sep 17 00:00:00 2001 From: Leon Breedt Date: Sat, 26 Mar 2005 00:20:19 +0000 Subject: allow direct dispatching methods to declare their parameters as well, for brevity's sake, it seems to be counter-intuitive not to do so (closes #939). update gem require versions. fix unit tests for exception de-shallowing changes. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@992 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionwebservice/lib/action_web_service.rb | 6 +++--- actionwebservice/lib/action_web_service/dispatcher/abstract.rb | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'actionwebservice/lib') diff --git a/actionwebservice/lib/action_web_service.rb b/actionwebservice/lib/action_web_service.rb index 2865dff633..61e451b704 100644 --- a/actionwebservice/lib/action_web_service.rb +++ b/actionwebservice/lib/action_web_service.rb @@ -27,9 +27,9 @@ begin require 'active_record' rescue LoadError require 'rubygems' - require_gem 'activesupport', '>= 0.9.0' - require_gem 'actionpack', '>= 1.4.0' - require_gem 'activerecord', '>= 1.6.0' + require_gem 'activesupport', '>= 1.0.2' + require_gem 'actionpack', '>= 1.6.0' + require_gem 'activerecord', '>= 1.9.0' end $:.unshift(File.dirname(__FILE__) + "/action_web_service/vendor/") diff --git a/actionwebservice/lib/action_web_service/dispatcher/abstract.rb b/actionwebservice/lib/action_web_service/dispatcher/abstract.rb index 1df03d1777..b63fe65ce1 100644 --- a/actionwebservice/lib/action_web_service/dispatcher/abstract.rb +++ b/actionwebservice/lib/action_web_service/dispatcher/abstract.rb @@ -34,7 +34,12 @@ module ActionWebService # :nodoc: def web_service_direct_invoke(invocation) @method_params = invocation.method_ordered_params - return_value = self.__send__(invocation.api_method_name) + arity = method(invocation.api_method_name).arity rescue 0 + if arity < 0 || arity > 0 + return_value = self.__send__(invocation.api_method_name, *@method_params) + else + return_value = self.__send__(invocation.api_method_name) + end if invocation.api.has_api_method?(invocation.api_method_name) returns = invocation.returns ? invocation.returns[0] : nil else -- cgit v1.2.3