rubocop: fix various style issues.

This commit is contained in:
evazion
2019-12-22 16:21:58 -06:00
parent 09f6a84660
commit 309821bf73
288 changed files with 912 additions and 962 deletions

View File

@@ -1,5 +1,5 @@
class Favorite < ApplicationRecord
class Error < Exception ; end
class Error < Exception; end
belongs_to :post
belongs_to :user
@@ -34,7 +34,7 @@ class Favorite < ApplicationRecord
return unless Favorite.for_user(user.id).where(:user_id => user.id, :post_id => post_id).exists?
Favorite.for_user(user.id).where(post_id: post_id).delete_all
Post.where(:id => post_id).update_all("fav_count = fav_count - 1")
post.delete_user_from_fav_string(user.id) if post
post&.delete_user_from_fav_string(user.id)
User.where(:id => user.id).update_all("favorite_count = favorite_count - 1")
user.favorite_count -= 1
post.fav_count -= 1 if post