Permalink
Browse files

Use Mongoid syntax to populate the live flag.

  • Loading branch information...
1 parent e647e1f commit 8d062c7cea33c07f447fdf8e3828786807e9ead1 @fatbusinessman fatbusinessman committed Jul 2, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 lib/tasks/live_flag.rake
@@ -2,8 +2,7 @@ namespace :live_flag do
task :populate => :environment do
# Disable the search observer to avoid a mass update of Rummager
Artefact.observers.disable :update_search_observer do
- Artefact.where(:owning_app.ne => "publisher").
- update_all({"$set" => { live: true }})
+ Artefact.where(:owning_app.ne => "publisher").update(live: true)
Artefact.where(owning_app: "publisher").each do |artefact|
artefact.live = artefact.any_editions_published?
artefact.save!

0 comments on commit 8d062c7

Please sign in to comment.