M
mgerstenblatt
Hi, Is there an alternative to calling a Module method from a nested
class? The code:
module GroupSweeper
=A0 def expire_cache(paths)
=A0 =A0 paths.each do |path|
=A0 =A0 =A0 expire_page(path)
=A0 =A0 end
=A0 end
=A0 class SweeperOne < ActionController::Caching::Sweeper
=A0 =A0 include GroupSweeper
=A0 =A0 observe Subject
=A0 =A0 def after_save(subject)
=A0 =A0 =A0 expire_cache([root_path,subjects_path])
=A0 =A0 end
=A0 =A0 def after_destroy(subject)
=A0 =A0 =A0 expire_cache([root_path,subjects_path])
=A0 =A0 end
=A0 end
end
How can I call GroupSweeper's expire_cache method from within
SweeperOne without explicitely including it? Should I not be doing
this?
class? The code:
module GroupSweeper
=A0 def expire_cache(paths)
=A0 =A0 paths.each do |path|
=A0 =A0 =A0 expire_page(path)
=A0 =A0 end
=A0 end
=A0 class SweeperOne < ActionController::Caching::Sweeper
=A0 =A0 include GroupSweeper
=A0 =A0 observe Subject
=A0 =A0 def after_save(subject)
=A0 =A0 =A0 expire_cache([root_path,subjects_path])
=A0 =A0 end
=A0 =A0 def after_destroy(subject)
=A0 =A0 =A0 expire_cache([root_path,subjects_path])
=A0 =A0 end
=A0 end
end
How can I call GroupSweeper's expire_cache method from within
SweeperOne without explicitely including it? Should I not be doing
this?