Issue 105: Enumerable type problem
Status:  WontFix
Owner: ----
Closed:  Aug 2008
Reported by tsenart, Jun 28, 2008
What steps will reproduce the problem?
1. script/server
2. Go to admin
3. Go to content

What is the expected output? What do you see instead?
 NoMethodError in Admin/content_nodes#index

Showing admin/content_nodes/list.rhtml where line #63 raised:

undefined method `length' for #<Enumerable::Enumerator:0x7f8d618263d8>

Extracted source (around line #63):

60:     <% for content_node in @content_nodes %>
61:     <tr class="<%= alternate %>">
62:       <td>
63:         <%= link_to truncate(content_node.name, 20), {:action =>
'edit', :id => content_node} %>
64:         <br/>
65:         <br/>
66:         <span class="info"><%= link_to 'Show here', {:action => 'show',
:id => content_node}, :class=> 'normal' %></span>

RAILS_ROOT: /home/tomas/ZENPT/substruct_test
Application Trace | Framework Trace | Full Trace

vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb:50:in `truncate'
vendor/plugins/substruct/app/views/admin/content_nodes/list.rhtml:63:in
`_run_erb_47vendor47plugins47substruct47app47views47admin47content_nodes47list46rhtml'
vendor/plugins/substruct/app/views/admin/content_nodes/list.rhtml:60:in `each'
vendor/plugins/substruct/app/views/admin/content_nodes/list.rhtml:60:in
`_run_erb_47vendor47plugins47substruct47app47views47admin47content_nodes47list46rhtml'
vendor/rails/actionpack/lib/action_view/base.rb:637:in `send'
vendor/rails/actionpack/lib/action_view/base.rb:637:in
`compile_and_render_template'
vendor/rails/actionpack/lib/action_view/base.rb:365:in `render_template'
vendor/rails/actionpack/lib/action_view/base.rb:316:in `render_file'
vendor/rails/actionpack/lib/action_controller/base.rb:1100:in `render_for_file'
vendor/rails/actionpack/lib/action_controller/base.rb:858:in
`render_with_no_layout'
vendor/rails/actionpack/lib/action_controller/base.rb:872:in
`render_with_no_layout'
vendor/rails/actionpack/lib/action_controller/layout.rb:262:in
`render_without_benchmark'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
vendor/plugins/substruct/app/controllers/admin/content_nodes_controller.rb:6:in
`index'
vendor/rails/actionpack/lib/action_controller/base.rb:1158:in `send'
vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
`perform_action_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:697:in `call_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:689:in
`perform_action_without_benchmark'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
vendor/rails/actionpack/lib/action_controller/rescue.rb:199:in
`perform_action_without_caching'
vendor/rails/actionpack/lib/action_controller/caching.rb:678:in
`perform_action'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in
`cache'
vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
vendor/rails/actionpack/lib/action_controller/caching.rb:677:in
`perform_action'
vendor/rails/actionpack/lib/action_controller/base.rb:524:in `send'
vendor/rails/actionpack/lib/action_controller/base.rb:524:in
`process_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:685:in
`process_without_session_management_support'
vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in
`process'
vendor/rails/actionpack/lib/action_controller/base.rb:388:in `process'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:171:in
`handle_request'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in `dispatch'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in
`dispatch_cgi'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:54:in
`serve_rails'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:74:in `call'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:59:in
`pre_process'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:50:in `process'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:35:in
`receive_data'
/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/eventmachine.rb:224:in
`run_machine'
/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/eventmachine.rb:224:in
`run'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/backends/base.rb:45:in `start'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/server.rb:146:in `start'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/controllers/controller.rb:79:in
`start'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:in `send'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:in `run_command'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:136:in `run!'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/bin/thin:6
/usr/bin/thin:19:in `load'
/usr/bin/thin:19

vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb:50:in `truncate'
vendor/plugins/substruct/app/views/admin/content_nodes/list.rhtml:63:in
`_run_erb_47vendor47plugins47substruct47app47views47admin47content_nodes47list46rhtml'
vendor/plugins/substruct/app/views/admin/content_nodes/list.rhtml:60:in `each'
vendor/plugins/substruct/app/views/admin/content_nodes/list.rhtml:60:in
`_run_erb_47vendor47plugins47substruct47app47views47admin47content_nodes47list46rhtml'
vendor/rails/actionpack/lib/action_view/base.rb:637:in `send'
vendor/rails/actionpack/lib/action_view/base.rb:637:in
`compile_and_render_template'
vendor/rails/actionpack/lib/action_view/base.rb:365:in `render_template'
vendor/rails/actionpack/lib/action_view/base.rb:316:in `render_file'
vendor/rails/actionpack/lib/action_controller/base.rb:1100:in `render_for_file'
vendor/rails/actionpack/lib/action_controller/base.rb:858:in
`render_with_no_layout'
vendor/rails/actionpack/lib/action_controller/base.rb:872:in
`render_with_no_layout'
vendor/rails/actionpack/lib/action_controller/layout.rb:262:in
`render_without_benchmark'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
vendor/plugins/substruct/app/controllers/admin/content_nodes_controller.rb:6:in
`index'
vendor/rails/actionpack/lib/action_controller/base.rb:1158:in `send'
vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
`perform_action_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:697:in `call_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:689:in
`perform_action_without_benchmark'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
vendor/rails/actionpack/lib/action_controller/rescue.rb:199:in
`perform_action_without_caching'
vendor/rails/actionpack/lib/action_controller/caching.rb:678:in
`perform_action'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in
`cache'
vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
vendor/rails/actionpack/lib/action_controller/caching.rb:677:in
`perform_action'
vendor/rails/actionpack/lib/action_controller/base.rb:524:in `send'
vendor/rails/actionpack/lib/action_controller/base.rb:524:in
`process_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:685:in
`process_without_session_management_support'
vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in
`process'
vendor/rails/actionpack/lib/action_controller/base.rb:388:in `process'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:171:in
`handle_request'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in `dispatch'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in
`dispatch_cgi'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:54:in
`serve_rails'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:74:in `call'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:59:in
`pre_process'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:50:in `process'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:35:in
`receive_data'
/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/eventmachine.rb:224:in
`run_machine'
/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/eventmachine.rb:224:in
`run'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/backends/base.rb:45:in `start'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/server.rb:146:in `start'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/controllers/controller.rb:79:in
`start'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:in `send'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:in `run_command'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:136:in `run!'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/bin/thin:6

vendor/rails/actionpack/lib/action_view/helpers/text_helper.rb:50:in `truncate'
vendor/plugins/substruct/app/views/admin/content_nodes/list.rhtml:63:in
`_run_erb_47vendor47plugins47substruct47app47views47admin47content_nodes47list46rhtml'
vendor/plugins/substruct/app/views/admin/content_nodes/list.rhtml:60:in `each'
vendor/plugins/substruct/app/views/admin/content_nodes/list.rhtml:60:in
`_run_erb_47vendor47plugins47substruct47app47views47admin47content_nodes47list46rhtml'
vendor/rails/actionpack/lib/action_view/base.rb:637:in `send'
vendor/rails/actionpack/lib/action_view/base.rb:637:in
`compile_and_render_template'
vendor/rails/actionpack/lib/action_view/base.rb:365:in `render_template'
vendor/rails/actionpack/lib/action_view/base.rb:316:in `render_file'
vendor/rails/actionpack/lib/action_controller/base.rb:1100:in `render_for_file'
vendor/rails/actionpack/lib/action_controller/base.rb:858:in
`render_with_no_layout'
vendor/rails/actionpack/lib/action_controller/base.rb:872:in
`render_with_no_layout'
vendor/rails/actionpack/lib/action_controller/layout.rb:262:in
`render_without_benchmark'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
vendor/plugins/substruct/app/controllers/admin/content_nodes_controller.rb:6:in
`index'
vendor/rails/actionpack/lib/action_controller/base.rb:1158:in `send'
vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
`perform_action_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:697:in `call_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:689:in
`perform_action_without_benchmark'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
vendor/rails/actionpack/lib/action_controller/rescue.rb:199:in
`perform_action_without_caching'
vendor/rails/actionpack/lib/action_controller/caching.rb:678:in
`perform_action'
vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in
`cache'
vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
vendor/rails/actionpack/lib/action_controller/caching.rb:677:in
`perform_action'
vendor/rails/actionpack/lib/action_controller/base.rb:524:in `send'
vendor/rails/actionpack/lib/action_controller/base.rb:524:in
`process_without_filters'
vendor/rails/actionpack/lib/action_controller/filters.rb:685:in
`process_without_session_management_support'
vendor/rails/actionpack/lib/action_controller/session_management.rb:123:in
`process'
vendor/rails/actionpack/lib/action_controller/base.rb:388:in `process'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:171:in
`handle_request'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:115:in `dispatch'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:126:in
`dispatch_cgi'
vendor/rails/actionpack/lib/action_controller/dispatcher.rb:9:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:54:in
`serve_rails'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/rack/adapter/rails.rb:74:in `call'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:59:in
`pre_process'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:50:in `process'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/connection.rb:35:in
`receive_data'
/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/eventmachine.rb:224:in
`run_machine'
/usr/lib/ruby/gems/1.8/gems/eventmachine-0.12.0/lib/eventmachine.rb:224:in
`run'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/backends/base.rb:45:in `start'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/server.rb:146:in `start'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/controllers/controller.rb:79:in
`start'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:in `send'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:166:in `run_command'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/lib/thin/runner.rb:136:in `run!'
/usr/lib/ruby/gems/1.8/gems/thin-0.8.2/bin/thin:6
/usr/bin/thin:19:in `load'
/usr/bin/thin:19

Request

Parameters:

None

Show session dump

--- 
:last_content_list_view: 
:last_order_list_view: Ready To Ship
:return_to: /customers/orders
:cart: !ruby/object:Cart 
  items: []

  shipping_cost: 0.0
  tax: 0.0
  total: 0.0
:user: 1
flash: !map:ActionController::Flash::FlashHash {}


Response

Headers:

{"cookie"=>[],
 "Cache-Control"=>"no-cache"}

What version of the product are you using? On what operating system?

rails 2.1.0
RedCloth 3.0.4
rake 0.8.1
mime-types 1.15
mini_magick 1.2.3
rmagick 2.5.1
ezcryptoo 0.7
fastercsv 1.2.3

Running on Arch Linux.





Please provide any additional information below.

 
Jun 28, 2008
#1 edmundo...@gmail.com
I cannot reproduce this in the trunk. If you changed the rails version from 2.0.2 to
2.1.0 then its not a bug and you are compromising yourself to administrate your own fork.
Jul 18, 2008
#2 fred.the...@gmail.com
He didnt mention that this issue happens with the new Ruby 1.8.7 patch0;
but works with ruby 1.8.7 patch22
Aug 15, 2008
Project Member #3 subim...@gmail.com
(No comment was entered for this change.)
Status: WontFix