Commit 96d00c4ef571a17bccf65011851875cc5a155ae2
Exists in
master
and in
1 other branch
Merge branch 'master' into force-invalid-vote
Showing
2 changed files
with
11 additions
and
1 deletions
Show diff stats
README.markdown
| ... | ... | @@ -11,6 +11,10 @@ API Documentation |
| 11 | 11 | ------------------- |
| 12 | 12 | <https://github.com/allourideas/pairwise-api/wiki/API-Documentation> |
| 13 | 13 | |
| 14 | +Getting Started Using the API | |
| 15 | +------------------- | |
| 16 | + | |
| 17 | +<https://github.com/allourideas/pairwise-api/wiki/Getting-Started> | |
| 14 | 18 | |
| 15 | 19 | Ownership |
| 16 | 20 | ------------------- | ... | ... |
lib/tasks/prune_db.rake
| ... | ... | @@ -211,7 +211,13 @@ namespace :prune_db do |
| 211 | 211 | |
| 212 | 212 | desc "Update cached values for prompts on left and right for choices." |
| 213 | 213 | task :update_cached_prompts_on_left_right => :environment do |
| 214 | - Question.all.each do |question| | |
| 214 | + question_ids = ENV["question_ids"].split(/[\s,]+/) if ENV["question_ids"] | |
| 215 | + if !question_ids.blank? | |
| 216 | + questions = Question.find(question_ids) | |
| 217 | + else | |
| 218 | + questions = Question.all | |
| 219 | + end | |
| 220 | + questions.each do |question| | |
| 215 | 221 | question.choices.each do |choice| |
| 216 | 222 | choice.reload |
| 217 | 223 | Choice.update_counters choice.id, | ... | ... |