Skip to content

Commit

Permalink
make voteable module compatible with mongoid 3
Browse files Browse the repository at this point in the history
  • Loading branch information
dcu committed Jul 30, 2012
1 parent dc9f9db commit 79ef498
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mongoid_ext/voteable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def voted?(voter_id)
if self[:votes] && !self[:votes].empty?
self[:votes].include?(voter_id)
else
self.class.exists?(:conditions => {:_id => self.id, :"votes.#{voter_id}".exists => true})
self.class.where({:_id => self.id, :"votes.#{voter_id}".exists => true}).exists?
end
end

Expand Down

0 comments on commit 79ef498

Please sign in to comment.