added config option for sweepers in admin base controller
Olli Huotari
committed Feb 12, 2012
commit 182838be9189313b5591487774468393ecef9495
Showing 2
changed files with
6 additions
and 0 deletions
app/controllers/cms_admin/base_controller.rb
+2
-0
| @@ | @@ -12,6 +12,8 @@ class CmsAdmin::BaseController < ApplicationController |
| :except => :jump | |
| layout 'cms_admin' | |
| + | |
| + | cache_sweeper ComfortableMexicanSofa.config.admin_sweeper.to_s.constantize if ComfortableMexicanSofa.config.admin_sweeper |
| def jump | |
| path = ComfortableMexicanSofa.config.admin_route_redirect | |
comfortable_mexican_sofa/configuration.rb b/lib/comfortable_mexican_sofa/configuration.rb
+4
-0
| @@ | @@ -7,6 +7,9 @@ class ComfortableMexicanSofa::Configuration |
| # Module that will handle authentication to access cms-admin area | |
| attr_accessor :admin_auth | |
| + | |
| + | # A class that is included as a sweeper to admin base controller if it's set |
| + | attr_accessor :admin_sweeper |
| # Module that will handle authentication for public pages | |
| attr_accessor :public_auth | |
| @@ | @@ -53,6 +56,7 @@ class ComfortableMexicanSofa::Configuration |
| def initialize | |
| @cms_title = 'ComfortableMexicanSofa CMS Engine' | |
| @admin_auth = 'ComfortableMexicanSofa::HttpAuth' | |
| + | @admin_sweeper = false |
| @public_auth = 'ComfortableMexicanSofa::DummyAuth' | |
| @seed_data_path = nil | |
| @admin_route_prefix = 'cms-admin' | |