base_controller.rb
上传用户:netsea168
上传日期:2022-07-22
资源大小:4652k
文件大小:1k
- class Admin::BaseController < ApplicationController
- cattr_accessor :look_for_migrations
- @@look_for_migrations = true
- layout 'administration'
- before_filter :login_required, :except => [ :login, :signup ]
- before_filter :look_for_needed_db_updates, :except => [:login, :signup, :update_database, :migrate]
- private
- def look_for_needed_db_updates
- if Migrator.offer_migration_when_available
- redirect_to :controller => '/admin/settings', :action => 'update_database' if Migrator.current_schema_version != Migrator.max_schema_version
- end
- end
- def sweep_cache
- PageCache.sweep_all
- end
- end