PiRSquared17 / activescaffold

Automatically exported from code.google.com/p/activescaffold
MIT License
0 stars 0 forks source link

500 error with nested scaffolds and ActionController::Caching::Sweeper #753

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set up a caching sweeper (such as with acts_as_audited - though any caching 
sweeper on your scaffolded controllers should do)
2. enable caching (config.action_controller.perform_caching = true)
3. Configure scaffolding for 2 associated models so that you can trigger the 
nested action ( A has_many B) 
4. Navigate to the parent model scaffold in browser
5. click on association link for nested display

What is the expected output? What do you see instead?

Expected: Nested tabular display

Actual:
NoMethodError in Admin/partnersController#nested
undefined method `controller_name' for nil:NilClass

What version (or revision) of the product are you using?

Most recent master from github 
(http://github.com/activescaffold/active_scaffold/tree/8033adef7606a04d592607c3e
ad965e612119daf)

If this bug causes an exception, please paste at least the first 20 lines below.

/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:
52:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/caching/sweep
er.rb:32:in `callback'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/caching/sweep
er.rb:14:in `after'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:20
8
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:
182:in `call'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:
182:in `evaluate_method'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:18
4:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:63
5:in `run_before_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:61
5:in `call_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:61
0:in `perform_action_without_benchmark'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.
rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benc
hmark.rb:17:in `ms'
/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benc
hmark.rb:17:in `ms'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.
rb:68:in `perform_action_without_rescue'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160
:in `perform_action_without_flash'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:
in `perform_action_without_render_component'
/home/robg/projects/alpha_trunk/vendor/plugins/render_component/lib/components.r
b:39:in `perform_action'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:i
n `send'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:i
n `process_without_filters'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:60
6:in `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:i
n `process'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:i
n `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route
_set.rb:437:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb
:87:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb
:121:in `_call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb
:130
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coerci
on.rb:25:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/string_coerci
on.rb:25:in `call'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/vendor/rack-1.0.0-git/lib/rack/head.
rb:9:in `call'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/vendor/rack-1.0.0-git/lib/rack/metho
doverride.rb:24:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/params_parser
.rb:15:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/session/abstr
act_store.rb:122:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:
29:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adap
ters/abstract/query_cache.rb:34:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:
9:in `cache'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/query_cache.rb:
28:in `call'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adap
ters/abstract/connection_pool.rb:361:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/failsafe.rb:2
6:in `call'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/vendor/rack-1.0.0-git/lib/rack/lock.
rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/vendor/rack-1.0.0-git/lib/rack/lock.
rb:11:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/vendor/rack-1.0.0-git/lib/rack/lock.
rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb
:114:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/reloader.rb:3
4:in `run'
/usr/lib/ruby/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb
:108:in `call'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/rack/request_h
andler.rb:95:in `process_request'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_reque
st_handler.rb:207:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/railz/applicat
ion_spawner.rb:378:in `start_request_handler'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/railz/applicat
ion_spawner.rb:336:in `handle_spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/utils.rb:183:i
n `safe_fork'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/railz/applicat
ion_spawner.rb:334:in `handle_spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_serve
r.rb:352:in `__send__'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_serve
r.rb:352:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_serve
r.rb:196:in `start_synchronously'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_serve
r.rb:163:in `start'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/railz/applicat
ion_spawner.rb:213:in `start'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/spawn_manager.
rb:262:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_serve
r_collection.rb:126:in `lookup_or_add'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/spawn_manager.
rb:256:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_serve
r_collection.rb:80:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_serve
r_collection.rb:79:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/spawn_manager.
rb:255:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/spawn_manager.
rb:154:in `spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/spawn_manager.
rb:287:in `handle_spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_serve
r.rb:352:in `__send__'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_serve
r.rb:352:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/lib/phusion_passenger/abstract_serve
r.rb:196:in `start_synchronously'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/bin/passenger-spawn-server:61

Original issue reported on code.google.com by rob.golk...@gmail.com on 14 Jun 2010 at 11:27

GoogleCodeExporter commented 9 years ago
see also: http://github.com/rails/render_component/issues#issue/1

Original comment by rob.golk...@gmail.com on 14 Jun 2010 at 11:32

GoogleCodeExporter commented 9 years ago
And also: http://github.com/collectiveidea/acts_as_audited/issues#issue/20

Original comment by rob.golk...@gmail.com on 14 Jun 2010 at 11:33

GoogleCodeExporter commented 9 years ago
According those bug reports it's a rails/action_pack bug, or a misuse of 
cache_action

Original comment by sergio.c...@gmail.com on 15 Jun 2010 at 2:44