Fix `Rails/WhereExists` cop in REST::TagSerializer model (#28790)
parent
329911b0a3
commit
4ec7d7d989
|
@ -86,7 +86,6 @@ Rails/WhereExists:
|
||||||
- 'app/models/status.rb'
|
- 'app/models/status.rb'
|
||||||
- 'app/policies/status_policy.rb'
|
- 'app/policies/status_policy.rb'
|
||||||
- 'app/serializers/rest/announcement_serializer.rb'
|
- 'app/serializers/rest/announcement_serializer.rb'
|
||||||
- 'app/serializers/rest/tag_serializer.rb'
|
|
||||||
- 'app/services/activitypub/fetch_remote_status_service.rb'
|
- 'app/services/activitypub/fetch_remote_status_service.rb'
|
||||||
- 'app/services/vote_service.rb'
|
- 'app/services/vote_service.rb'
|
||||||
- 'app/validators/reaction_validator.rb'
|
- 'app/validators/reaction_validator.rb'
|
||||||
|
|
|
@ -19,7 +19,7 @@ class REST::TagSerializer < ActiveModel::Serializer
|
||||||
if instance_options && instance_options[:relationships]
|
if instance_options && instance_options[:relationships]
|
||||||
instance_options[:relationships].following_map[object.id] || false
|
instance_options[:relationships].following_map[object.id] || false
|
||||||
else
|
else
|
||||||
TagFollow.where(tag_id: object.id, account_id: current_user.account_id).exists?
|
TagFollow.exists?(tag_id: object.id, account_id: current_user.account_id)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue