favoriting now triggers an upvote

This commit is contained in:
r888888888
2016-02-22 16:59:57 -08:00
parent 2a87aad34e
commit bb3eb9f980
2 changed files with 6 additions and 8 deletions

View File

@@ -840,6 +840,8 @@ class Post < ActiveRecord::Base
def add_favorite!(user)
Favorite.add(self, user)
vote!("up")
rescue PostVote::Error
end
def delete_user_from_fav_string(user_id)
@@ -848,6 +850,8 @@ class Post < ActiveRecord::Base
def remove_favorite!(user)
Favorite.remove(self, user)
unvote!
rescue PostVote::Error
end
def favorited_user_ids