diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-09-20 23:51:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-20 23:51:21 +0200 |
commit | 50948b46aabc0756d85bc6641f0bd3bcc09bf7d4 (patch) | |
tree | 19dd9e761aec2a33d6bc3c11b47673da40cd965b /app/models/follow_request.rb | |
parent | 882e54c78678bd4247d70fe5b04571543769bcee (diff) |
Add ability to filter followed accounts' posts by language (#19095)
Diffstat (limited to 'app/models/follow_request.rb')
-rw-r--r-- | app/models/follow_request.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/follow_request.rb b/app/models/follow_request.rb index 0b6f7629a..9034250c0 100644 --- a/app/models/follow_request.rb +++ b/app/models/follow_request.rb @@ -11,6 +11,7 @@ # show_reblogs :boolean default(TRUE), not null # uri :string # notify :boolean default(FALSE), not null +# languages :string is an Array # class FollowRequest < ApplicationRecord @@ -27,9 +28,10 @@ class FollowRequest < ApplicationRecord has_one :notification, as: :activity, dependent: :destroy validates :account_id, uniqueness: { scope: :target_account_id } + validates :languages, language: true def authorize! - account.follow!(target_account, reblogs: show_reblogs, notify: notify, uri: uri, bypass_limit: true) + account.follow!(target_account, reblogs: show_reblogs, notify: notify, languages: languages, uri: uri, bypass_limit: true) MergeWorker.perform_async(target_account.id, account.id) if account.local? destroy! end |