theoooo-tally 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/tally/voter.rb +2 -6
  2. metadata +1 -1
data/lib/tally/voter.rb CHANGED
@@ -25,28 +25,24 @@ module Tally
25
25
 
26
26
  def vote tallyable, value
27
27
  # TODO: Figure out why i can't just reference :tallyable => tallyable
28
- votes.tally(tallyable).find(:first).try(:update_attribute, :for, !!value) ||
29
- votes.create(:tallyable_id => tallyable.id, :tallyable_type => tallyable.class.to_s, :for => !!value)
28
+ votes.tally(tallyable).find(:first).try(:update_attribute, :for, value) ||
29
+ votes.create(:tallyable_id => tallyable.id, :tallyable_type => tallyable.class.to_s, :for => value)
30
30
  end
31
31
 
32
32
  def vote_destroy tallyable
33
33
  votes.tally(tallyable).find(:first).try(:destroy)
34
- # votes.find(:first, :conditions => {:tallyable => tallyable}).try(:destroy)
35
34
  end
36
35
 
37
36
  def voted_for? tallyable
38
37
  !!votes.tally(tallyable).find(:first, :conditions => {:for => true})
39
- # !!votes.find(:first, :conditions => {:tallyable => tallyable, :for => true})
40
38
  end
41
39
 
42
40
  def voted_against? tallyable
43
41
  !!votes.tally(tallyable).find(:first, :conditions => {:for => false})
44
- # !!votes.find(:first, :conditions => {:tallyable => tallyable, :for => false})
45
42
  end
46
43
 
47
44
  def voted_on? tallyable
48
45
  !!votes.tally(tallyable).find(:first)
49
- # !!votes.find(:first, :conditions => {:tallyable => tallyable})
50
46
  end
51
47
 
52
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: theoooo-tally
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Theo Cushion