Fix problems with database offline mode
This commit is contained in:
parent
0a81411e68
commit
59a49a6ef5
4 changed files with 7 additions and 4 deletions
|
@ -4,6 +4,9 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
if STATUS == :database_readonly or STATUS == :database_offline
|
||||
session :off
|
||||
|
||||
def self.cache_sweeper(*sweepers)
|
||||
end
|
||||
end
|
||||
|
||||
def authorize_web
|
||||
|
|
|
@ -10,7 +10,7 @@ class DiaryEntryController < ApplicationController
|
|||
|
||||
caches_action :list, :view, :layout => false
|
||||
caches_action :rss, :layout => true
|
||||
cache_sweeper :diary_sweeper, :only => [:new, :edit, :comment, :hide, :hidecomment], :unless => STATUS == :database_offline
|
||||
cache_sweeper :diary_sweeper, :only => [:new, :edit, :comment, :hide, :hidecomment]
|
||||
|
||||
def new
|
||||
@title = t 'diary_entry.new.title'
|
||||
|
|
|
@ -18,8 +18,8 @@ class TraceController < ApplicationController
|
|||
caches_action :list, :unless => :logged_in?, :layout => false
|
||||
caches_action :view, :layout => false
|
||||
caches_action :georss, :layout => true
|
||||
cache_sweeper :trace_sweeper, :only => [:create, :edit, :delete, :api_create, :api_update, :api_delete], :unless => STATUS == :database_offline
|
||||
cache_sweeper :tracetag_sweeper, :only => [:create, :edit, :delete, :api_create, :api_update, :api_delete], :unless => STATUS == :database_offline
|
||||
cache_sweeper :trace_sweeper, :only => [:create, :edit, :delete, :api_create, :api_update, :api_delete]
|
||||
cache_sweeper :tracetag_sweeper, :only => [:create, :edit, :delete, :api_create, :api_update, :api_delete]
|
||||
|
||||
# Counts and selects pages of GPX traces for various criteria (by user, tags, public etc.).
|
||||
# target_user - if set, specifies the user to fetch traces for. if not set will fetch all traces
|
||||
|
|
|
@ -17,7 +17,7 @@ class UserController < ApplicationController
|
|||
|
||||
filter_parameter_logging :password, :pass_crypt, :pass_crypt_confirmation
|
||||
|
||||
cache_sweeper :user_sweeper, :only => [:account, :set_status, :delete], :unless => STATUS == :database_offline
|
||||
cache_sweeper :user_sweeper, :only => [:account, :set_status, :delete]
|
||||
|
||||
def terms
|
||||
@legale = params[:legale] || OSM.IPToCountry(request.remote_ip) || DEFAULT_LEGALE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue