mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Use ActiveModel::Attributes in FollowLimitable concern (#35327)
This commit is contained in:
parent
28633a504a
commit
c442589593
1 changed files with 2 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue