Skip to content

Commit

Permalink
bug fixed for voter/voteable classes tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
angelim committed Jul 18, 2011
1 parent e93e880 commit 0aa067b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/voteable_mongo/tasks.rb
Expand Up @@ -132,15 +132,15 @@ def self.update_parent_for_embedded_classes(embedded_classes, log)
end

def self.remake_stats_for(doc, voteable)
up_count = doc.up_voter_ids.length
down_count = doc.down_voter_ids.length
faceless_up_count = doc.faceless_up_count
faceless_down_count = doc.faceless_down_count
up_count = doc.up_voter_ids(voteable[:voting_field]).length
down_count = doc.down_voter_ids(voteable[:voting_field]).length
faceless_up_count = doc.faceless_up_count(voteable[:voting_field])
faceless_down_count = doc.faceless_down_count(voteable[:voting_field])

doc.update_attributes(
voteable[:voting_field] => {
'up' => doc.up_voter_ids,
'down' => doc.down_voter_ids,
'up' => doc.up_voter_ids(voteable[:voting_field]),
'down' => doc.down_voter_ids(voteable[:voting_field]),
'up_count' => up_count,
'faceless_up_count' => faceless_up_count,
'faceless_down_count' => faceless_down_count,
Expand Down

0 comments on commit 0aa067b

Please sign in to comment.