Skip to content

Commit

Permalink
Merge pull request #2466 from Shopify/0-9-stable-const-defined
Browse files Browse the repository at this point in the history
[0.9 stable] Avoid `Object.constants.include?`
  • Loading branch information
byroot committed Apr 10, 2024
2 parents 6d2f653 + 573e417 commit 9f7222c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_model/serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def serializer_for(resource, options = {})
if resource.respond_to?(:serializer_class)
resource.serializer_class
elsif resource.respond_to?(:to_ary)
if Object.constants.include?(:ArraySerializer)
if defined?(::ArraySerializer)
::ArraySerializer
else
ArraySerializer
Expand Down

0 comments on commit 9f7222c

Please sign in to comment.