From c442589593ac39f1f36c972890850c30efd3ca1b Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 10 Jul 2025 03:40:56 -0400 Subject: [PATCH] Use `ActiveModel::Attributes` in `FollowLimitable` concern (#35327) --- app/models/concerns/follow_limitable.rb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/app/models/concerns/follow_limitable.rb b/app/models/concerns/follow_limitable.rb index c64060d6e..fb8f76e9b 100644 --- a/app/models/concerns/follow_limitable.rb +++ b/app/models/concerns/follow_limitable.rb @@ -4,14 +4,8 @@ module FollowLimitable extend ActiveSupport::Concern included do - validates_with FollowLimitValidator, on: :create, unless: :bypass_follow_limit? - end + validates_with FollowLimitValidator, on: :create, unless: :bypass_follow_limit - def bypass_follow_limit=(value) - @bypass_follow_limit = value - end - - def bypass_follow_limit? - @bypass_follow_limit + attribute :bypass_follow_limit, :boolean, default: false end end