Commit ca2a2340af3255eb005b0c3540bfb9f4c9c06781
1 parent
9f8f7b6c
Exists in
master
and in
1 other branch
fix bug in user_generated_ideas over time response
Showing
2 changed files
with
3 additions
and
2 deletions
Show diff stats
CHANGELOG.md
1 | + * Fix bug in response user_generated_ideas totals over time, where the min and max dates were getting added as strings instead of date objects | ||
1 | * Update choices to act_as_versioned | 2 | * Update choices to act_as_versioned |
2 | 3 | ||
3 | ## Pairwise 3.0.1 (Apr 16, 2012) ### | 4 | ## Pairwise 3.0.1 (Apr 16, 2012) ### |
app/controllers/questions_controller.rb
@@ -250,8 +250,8 @@ class QuestionsController < InheritedResources::Base | @@ -250,8 +250,8 @@ class QuestionsController < InheritedResources::Base | ||
250 | data = Choice.count(:conditions => "choices.question_id = #{@question.id} AND choices.creator_id <> #{@question.creator_id}", | 250 | data = Choice.count(:conditions => "choices.question_id = #{@question.id} AND choices.creator_id <> #{@question.creator_id}", |
251 | :group => "date(choices.created_at)") | 251 | :group => "date(choices.created_at)") |
252 | # we want graphs to go from date of first vote -> date of last vote, so adding those two boundries here. | 252 | # we want graphs to go from date of first vote -> date of last vote, so adding those two boundries here. |
253 | - mindate = Vote.minimum('date(created_at)', :conditions => {:question_id => @question.id}) | ||
254 | - maxdate = Vote.maximum('date(created_at)', :conditions => {:question_id => @question.id}) | 253 | + mindate = Vote.minimum('date(created_at)', :conditions => {:question_id => @question.id}).to_date |
254 | + maxdate = Vote.maximum('date(created_at)', :conditions => {:question_id => @question.id}).to_date | ||
255 | 255 | ||
256 | data[mindate] = 0 if !data.include?(mindate) && !mindate.nil? | 256 | data[mindate] = 0 if !data.include?(mindate) && !mindate.nil? |
257 | data[maxdate] = 0 if !data.include?(maxdate) && !maxdate.nil? | 257 | data[maxdate] = 0 if !data.include?(maxdate) && !maxdate.nil? |