updated tests, switched to rails 3.0.0rc2
This commit is contained in:
@@ -2,15 +2,5 @@ class PostVote < ActiveRecord::Base
|
||||
class Error < Exception ; end
|
||||
|
||||
attr_accessor :is_positive
|
||||
validates_uniqueness_of :ip_addr, :scope => :post_id
|
||||
after_save :update_post_score
|
||||
belongs_to :post
|
||||
|
||||
def update_post_score
|
||||
if is_positive
|
||||
post.increment!(:score)
|
||||
else
|
||||
post.decrement!(:score)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user