Fixed that AWS Scaffold Fails with Struct as a Parameter (closes #4363) [joe@mjg2.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
ed10f873a1
commit
4a968d464b
|
@ -1,5 +1,7 @@
|
|||
*SVN*
|
||||
|
||||
* Fix Scaffold Fails with Struct as a Parameter #4363 [joe@mjg2.com]
|
||||
|
||||
* Fix soap type registration of multidimensional arrays (#4232)
|
||||
|
||||
* Fix that marshaler couldn't handle ActiveRecord models defined in a different namespace (#2392).
|
||||
|
|
|
@ -187,7 +187,8 @@ module ActionWebService
|
|||
nested_content = method_parameter_input_fields(
|
||||
method,
|
||||
member_type,
|
||||
"#{field_name_base}[#{idx}][#{member_name}]")
|
||||
"#{field_name_base}[#{idx}][#{member_name}]",
|
||||
idx)
|
||||
if member_type.custom?
|
||||
parameters << content_tag('li', label)
|
||||
parameters << content_tag('ul', nested_content)
|
||||
|
|
|
@ -18,6 +18,7 @@ end
|
|||
|
||||
class ScaffoldedControllerTestAPI < ActionWebService::API::Base
|
||||
api_method :hello, :expects => [{:integer=>:int}, :string], :returns => [:bool]
|
||||
api_method :hello_struct_param, :expects => [{:person => ScaffoldPerson}], :returns => [:bool]
|
||||
api_method :bye, :returns => [[ScaffoldPerson]]
|
||||
api_method :date_diff, :expects => [{:start_date => :date}, {:end_date => :date}], :returns => [:int]
|
||||
api_method :time_diff, :expects => [{:start_time => :time}, {:end_time => :time}], :returns => [:int]
|
||||
|
@ -31,6 +32,10 @@ class ScaffoldedController < ActionController::Base
|
|||
def hello(int, string)
|
||||
0
|
||||
end
|
||||
|
||||
def hello_struct_param(person)
|
||||
0
|
||||
end
|
||||
|
||||
def bye
|
||||
[ScaffoldPerson.new(:id => 1, :name => "leon"), ScaffoldPerson.new(:id => 2, :name => "paul")]
|
||||
|
@ -69,6 +74,11 @@ class ScaffoldedControllerTest < Test::Unit::TestCase
|
|||
get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'Hello'
|
||||
assert_rendered_file 'parameters.rhtml'
|
||||
end
|
||||
|
||||
def test_scaffold_invoke_method_params_with_struct
|
||||
get :scaffold_invoke_method_params, :service => 'scaffolded', :method => 'HelloStructParam'
|
||||
assert_rendered_file 'parameters.rhtml'
|
||||
end
|
||||
|
||||
def test_scaffold_invoke_submit_hello
|
||||
post :scaffold_invoke_submit, :service => 'scaffolded', :method => 'Hello', :method_params => {'0' => '5', '1' => 'hello world'}
|
||||
|
|
Loading…
Reference in New Issue