Forum: Ruby on Rails PageSweeper not working since upgrading to 1.1.1

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Martin S. (Guest)
on 2006-04-10 02:23
Hi, I upgraded from 1.0 to 1.1.1, now my cache sweepers acts up.
They worked perfectly before he upgrade, now I get strange errors.

I have an empty controller, it looks like this:

class PageElementsController < ApplicationController

  cache_sweeper :element_sweeper

  def element_container_show
    render :inline=>""
  end
end


The sweeper looks like this:


class ElementSweeper < ActionController::Caching::Sweeper
  observe PageElement
end

When I call the action element_container_show, I get this error:


NoMethodError (You have a nil object when you didn't expect it!
The error occured while evaluating nil.controller_name):
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/caching.rb:541:in
`callback'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/caching.rb:534:in
`after'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:227:in
`around_filter'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:227:in
`call'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:401:in
`call_filters'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:394:in
`each'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:394:in
`call_filters'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:389:in
`after_action'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:369:in
`perform_action_without_benchmark'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in
`measure'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in
`perform_action_without_rescue'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:in
`perform_action'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in
`send'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in
`process_without_filters'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:in
`process_without_session_management_support'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in
`process'
    /usr/lib/ruby/gems/1.8/gems/rails-1.1.1/lib/dispatcher.rb:38:in
`dispatch'
    /usr/lib/ruby/gems/1.8/gems/rails-1.1.1/lib/webrick_server.rb:115:in
`handle_dispatch'
    /usr/lib/ruby/gems/1.8/gems/rails-1.1.1/lib/webrick_server.rb:81:in
`service'
    /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
    /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
    /usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'
    /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'
    /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'
    /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'
    /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'
    /usr/lib/ruby/gems/1.8/gems/rails-1.1.1/lib/webrick_server.rb:67:in
`dispatch'
    /usr/lib/ruby/gems/1.8/gems/rails-1.1.1/lib/commands/servers/webrick.rb:59
    /usr/lib/ruby/1.8/rubygems/custom_require.rb:21:in `require__'
    /usr/lib/ruby/1.8/rubygems/custom_require.rb:21:in `require'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require'
    /usr/lib/ruby/gems/1.8/gems/rails-1.1.1/lib/commands/server.rb:30
    /usr/lib/ruby/1.8/rubygems/custom_require.rb:21:in `require__'
    /usr/lib/ruby/1.8/rubygems/custom_require.rb:21:in `require'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require'
    script/server:3

Can anybody reproduce this?

Martin
Martin S. (Guest)
on 2006-04-10 13:35
ok, this seems to be an engine problem. Moving this to the engines list
This topic is locked and can not be replied to.