diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-03-19 19:38:38 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-03-19 19:38:38 +0000 |
commit | a6cfb4e0e4209e06b4ba561b688ee2c3b942e3dd (patch) | |
tree | 2bf1656c898c35a021e779bf2bc833ae043eccae /actionpack/lib | |
parent | 9a72cd22cf427754a30af409c4651da2017296a8 (diff) | |
download | rails-a6cfb4e0e4209e06b4ba561b688ee2c3b942e3dd.tar.gz rails-a6cfb4e0e4209e06b4ba561b688ee2c3b942e3dd.tar.bz2 rails-a6cfb4e0e4209e06b4ba561b688ee2c3b942e3dd.zip |
Fix mixed case enumerable methods in the JavaScript Collection Proxy (closes #4314) [codyfauser@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3984 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_view/helpers/prototype_helper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb index 35a671c081..3d15f2ecfd 100644 --- a/actionpack/lib/action_view/helpers/prototype_helper.rb +++ b/actionpack/lib/action_view/helpers/prototype_helper.rb @@ -807,7 +807,7 @@ module ActionView end class JavaScriptCollectionProxy < JavaScriptProxy #:nodoc: - ENUMERABLE_METHODS_WITH_RETURN = [:all, :any, :collect, :map, :detect, :find, :findAll, :select, :max, :min, :partition, :reject, :sortBy] + ENUMERABLE_METHODS_WITH_RETURN = [:all, :any, :collect, :map, :detect, :find, :find_all, :select, :max, :min, :partition, :reject, :sort_by] ENUMERABLE_METHODS = ENUMERABLE_METHODS_WITH_RETURN + [:each] attr_reader :generator delegate :arguments_for_call, :to => :generator @@ -865,7 +865,7 @@ module ActionView method_args = arguments_for_call options[:method_args] # foo, bar, function method_args << ', ' unless method_args.blank? add_variable_assignment!(options[:variable]) if options[:variable] - append_enumerable_function!("#{enumerable}(#{method_args}function(#{yield_args}) {") + append_enumerable_function!("#{enumerable.to_s.first}#{enumerable.to_s.camelize[1..-1]}(#{method_args}function(#{yield_args}) {") # only yield as many params as were passed in the block yield *options[:yield_args].collect { |p| JavaScriptVariableProxy.new(@generator, p) }[0..block.arity-1] add_return_statement! if options[:return] |