]> git.openstreetmap.org Git - rails.git/commitdiff
Make database offline work in production
authorTom Hughes <tom@compton.nu>
Tue, 15 Jun 2010 09:40:47 +0000 (10:40 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 15 Jun 2010 09:40:47 +0000 (10:40 +0100)
app/controllers/diary_entry_controller.rb
app/controllers/trace_controller.rb
app/controllers/user_controller.rb
config/environment.rb

index 52ce742bfddf08870ae441e653e7855adb2e9458..320f3d029de3e7416de519f99150dc2a97e95445 100644 (file)
@@ -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'
index f8ce29abaaa972fff209b37189daff2f623189cb..c51f54c5e713b13899e2bb606b1875c5e6c8037b 100644 (file)
@@ -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
index d86c9a4bafef12ae71260ad06ba43002b8084ac5..0957853ce574cee1d900198be8aa45fd42b43359 100644 (file)
@@ -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'
index 55c2df4ae4185ed2d28e3ef3e0faaf35659000bc..de5852fc4316d857707b4984e34a62ac2aeb992a 100644 (file)
@@ -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.