mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-25 15:09:29 +00:00
Fix Style/ClassEqualityComparison
cop (#30058)
This commit is contained in:
parent
72484a194f
commit
348ccf206e
|
@ -31,14 +31,6 @@ Rails/OutputSafety:
|
|||
Exclude:
|
||||
- 'config/initializers/simple_form.rb'
|
||||
|
||||
# This cop supports unsafe autocorrection (--autocorrect-all).
|
||||
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
||||
# AllowedMethods: ==, equal?, eql?
|
||||
Style/ClassEqualityComparison:
|
||||
Exclude:
|
||||
- 'app/helpers/jsonld_helper.rb'
|
||||
- 'app/serializers/activitypub/outbox_serializer.rb'
|
||||
|
||||
# This cop supports safe autocorrection (--autocorrect).
|
||||
# Configuration parameters: AllowedVars.
|
||||
Style/FetchEnvVar:
|
||||
|
|
|
@ -141,7 +141,7 @@ module JsonLdHelper
|
|||
def safe_for_forwarding?(original, compacted)
|
||||
original.without('@context', 'signature').all? do |key, value|
|
||||
compacted_value = compacted[key]
|
||||
return false unless value.class == compacted_value.class
|
||||
return false unless value.instance_of?(compacted_value.class)
|
||||
|
||||
if value.is_a?(Hash)
|
||||
safe_for_forwarding?(value, compacted_value)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
class ActivityPub::OutboxSerializer < ActivityPub::CollectionSerializer
|
||||
def self.serializer_for(model, options)
|
||||
if model.class.name == 'ActivityPub::ActivityPresenter'
|
||||
if model.instance_of?(::ActivityPub::ActivityPresenter)
|
||||
ActivityPub::ActivitySerializer
|
||||
else
|
||||
super
|
||||
|
|
Loading…
Reference in a new issue