From: Tom Hughes Date: Tue, 15 Jun 2010 09:40:47 +0000 (+0100) Subject: Make database offline work in production X-Git-Tag: live~6867^2~2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/f973bee52b375af9228b972f8740676b86f06f88?ds=sidebyside Make database offline work in production --- diff --git a/app/controllers/diary_entry_controller.rb b/app/controllers/diary_entry_controller.rb index 52ce742bf..320f3d029 100644 --- a/app/controllers/diary_entry_controller.rb +++ b/app/controllers/diary_entry_controller.rb @@ -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] + cache_sweeper :diary_sweeper, :only => [:new, :edit, :comment, :hide, :hidecomment], :unless => OSM_STATUS == :database_offline def new @title = t 'diary_entry.new.title' diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index f8ce29aba..c51f54c5e 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -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] - cache_sweeper :tracetag_sweeper, :only => [:create, :edit, :delete, :api_create] + cache_sweeper :trace_sweeper, :only => [:create, :edit, :delete, :api_create], :unless => OSM_STATUS == :database_offline + cache_sweeper :tracetag_sweeper, :only => [:create, :edit, :delete, :api_create], :unless => OSM_STATUS == :database_offline # 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 diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index d86c9a4ba..0957853ce 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -16,7 +16,7 @@ class UserController < ApplicationController filter_parameter_logging :password, :pass_crypt, :pass_crypt_confirmation - cache_sweeper :user_sweeper, :only => [:account, :set_status, :delete] + cache_sweeper :user_sweeper, :only => [:account, :set_status, :delete], :unless => OSM_STATUS == :database_offline def terms @title = t 'user.new.title' diff --git a/config/environment.rb b/config/environment.rb index 55c2df4ae..de5852fc4 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -44,6 +44,7 @@ Rails::Initializer.run do |config| # To use Rails without a database, you must remove the Active Record framework if OSM_STATUS == :database_offline config.frameworks -= [ :active_record ] + config.eager_load_paths = [] end # Specify gems that this application depends on.