aboutsummaryrefslogtreecommitdiffstats
path: root/actionwebservice/lib
diff options
context:
space:
mode:
authorLeon Breedt <bitserf@gmail.com>2005-03-26 00:20:19 +0000
committerLeon Breedt <bitserf@gmail.com>2005-03-26 00:20:19 +0000
commit8032c4ffd47ba4deb5cbd88a462b837240eb593c (patch)
tree644884307c403b47c883a4c699ea0c8472fd75ac /actionwebservice/lib
parent771244a58ce812198e7171e4ee0ae5b27032ead0 (diff)
downloadrails-8032c4ffd47ba4deb5cbd88a462b837240eb593c.tar.gz
rails-8032c4ffd47ba4deb5cbd88a462b837240eb593c.tar.bz2
rails-8032c4ffd47ba4deb5cbd88a462b837240eb593c.zip
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
Diffstat (limited to 'actionwebservice/lib')
-rw-r--r--actionwebservice/lib/action_web_service.rb6
-rw-r--r--actionwebservice/lib/action_web_service/dispatcher/abstract.rb7
2 files changed, 9 insertions, 4 deletions
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