* Add point weights for tag follows * Adjust num articles to initially show up on home page * Fix schema.rb * Adjust follow policy spec * Adjust dashboard styling for follow points form
19 lines
286 B
Ruby
19 lines
286 B
Ruby
class FollowPolicy < ApplicationPolicy
|
|
def create?
|
|
!user_is_banned?
|
|
end
|
|
|
|
def update?
|
|
user_is_follower?
|
|
end
|
|
|
|
def permitted_attributes
|
|
%i[points]
|
|
end
|
|
|
|
private
|
|
|
|
def user_is_follower?
|
|
record.follower_id == user.id && record.follower_type == "User"
|
|
end
|
|
end
|