diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/array/wrap.rb | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/array/wrap.rb b/activesupport/lib/active_support/core_ext/array/wrap.rb index 38bb68c1ec..f48d5ce500 100644 --- a/activesupport/lib/active_support/core_ext/array/wrap.rb +++ b/activesupport/lib/active_support/core_ext/array/wrap.rb @@ -4,11 +4,10 @@ class Array def self.wrap(object) if object.nil? [] - # to_a doesn't work correctly with Array() but to_ary always does - elsif object.respond_to?(:to_a) && !object.respond_to?(:to_ary) - [object] + elsif object.respond_to?(:to_ary) + object.to_ary else - Array(object) + [object] end end end |