add limit of post per day

This commit is contained in:
João Victor Geonizeli
2022-02-27 17:10:15 -03:00
parent 1d692b31f8
commit 7a24f7950b
4 changed files with 41 additions and 1 deletions

View File

@@ -7,6 +7,8 @@ class UserFollow < ApplicationRecord
private
def user_cant_follow_himself
errors.add(:followed, 'can\'t follow himself') if follower_id == followed_id
if follower_id == followed_id
errors.add(:followed, 'can\'t follow himself')
end
end
end