omarzina / substruct

Automatically exported from code.google.com/p/substruct
0 stars 0 forks source link

Enumerable type problem #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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_nodes47list46
rhtml'
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_nodes47list46
rhtml'
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_c
ache.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_nodes47list46
rhtml'
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_nodes47list46
rhtml'
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_c
ache.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_nodes47list46
rhtml'
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_nodes47list46
rhtml'
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_c
ache.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.

Original issue reported on code.google.com by tsenart on 28 Jun 2008 at 11:06

GoogleCodeExporter commented 9 years ago
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.

Original comment by edmundo...@gmail.com on 29 Jun 2008 at 1:54

GoogleCodeExporter commented 9 years ago
He didnt mention that this issue happens with the new Ruby 1.8.7 patch0;
but works with ruby 1.8.7 patch22

Original comment by fred.the...@gmail.com on 18 Jul 2008 at 1:22

GoogleCodeExporter commented 9 years ago

Original comment by subim...@gmail.com on 16 Aug 2008 at 3:44