Commit a03397ff7fac7bb7d53ac298f40c14ff6c84c5da

Authored by Antonio Terceiro
1 parent f012cd59

ActionItem980: loading schema from scratch

Showing 1 changed file with 5 additions and 1 deletions   Show diff stats
config/environment.rb
... ... @@ -64,7 +64,11 @@ Rails::Initializer.run do |config|
64 64  
65 65 # Activate observers that should always be running
66 66 # config.active_record.observers = :cacher, :garbage_collector
67   - config.active_record.observers = :article_sweeper
  67 +
  68 + # don't load the sweepers while loading the database
  69 + unless $PROGRAM_NAME =~ /rake$/ && ARGV.first == 'db:schema:load'
  70 + config.active_record.observers = :article_sweeper
  71 + end
68 72 # Make Active Record use UTC-base instead of local time
69 73 # config.active_record.default_timezone = :utc
70 74  
... ...