"value must be enumerable" exception when using a sweeper?

Folks,

I’m going slightly crazy here - I implemented a Sweeper in an older app
and used nearly the same exact code in my new app, yet I keep getting
this ‘value must be enumerable’ exception. Even after I cut most of the
code away, I still get the error. If anyone can help, I would be much
obliged.

Notes: I’m using Engines… wonder if that could cause a problem. And
yet, if I ‘observe’ my User model, which is part of my main app and not
an engine or plugin, it still gives me the same exception.

Thanks!


application.rb:

cache_sweeper :commerce_sweeper


commerce_sweeper.rb:

class CommerceSweeper < ActionController::Caching::Sweeper
observe Product

def after_save(record)
end
end


exception:

C:/dev/ruby/lib/ruby/1.8/set.rb:275:in +' C:/dev/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.5/lib/active_record/observer.rb:149:ininitialize’
C:/dev/ruby/lib/ruby/1.8/singleton.rb:95:in new' C:/dev/ruby/lib/ruby/1.8/singleton.rb:95:ininstance’
C:/dev/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/caching.rb:570:in
cache_sweeper' C:/dev/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/caching.rb:568:ineach’
C:/dev/ruby/lib/ruby/gems/1.8/gems/actionpack-1.13.5/lib/action_controller/caching.rb:568:in
`cache_sweeper’
C:/dev/workspace/BocueCommerce/app/controllers/application.rb:12

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs