Browse files

Disable search/router updates in migration

Because we're not actually changing the state
  • Loading branch information...
1 parent 7c040dc commit 8c763c417311eb023f6e70e71d2edbe9b6178f56 @jamiecobbett jamiecobbett committed Aug 16, 2012
Showing with 8 additions and 6 deletions.
  1. +8 −6 lib/tasks/migrate.rake
View
14 lib/tasks/migrate.rake
@@ -23,13 +23,15 @@ namespace :migrate do
desc "Move Artefacts from the 'live' column to having a 'state' column"
task :move_artefacts_to_state_column => :environment do
- Artefact.all.each do |artefact|
- if artefact[:live]
- artefact.state = "live"
- else
- artefact.state = "draft"
+ Artefact.observers.disable :update_search_observer, :update_router_observer do
+ Artefact.all.each do |artefact|
+ if artefact[:live]
+ artefact.state = "live"
+ else
+ artefact.state = "draft"
+ end
+ artefact.save!
end
- artefact.save!
end
end
end

0 comments on commit 8c763c4

Please sign in to comment.