aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/api
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2018-06-14 22:58:50 +0300
committerbogdanvlviv <bogdanvlviv@gmail.com>2018-08-14 19:53:12 +0300
commite765bff13484b3c834f0e9979550196898dc7cc9 (patch)
tree7ac0633410674dae657bfa22577b0c1b6cf82b63 /railties/lib/rails/api
parent77b0126054178cb74c2b5bb17979462095144b7c (diff)
downloadrails-e765bff13484b3c834f0e9979550196898dc7cc9.tar.gz
rails-e765bff13484b3c834f0e9979550196898dc7cc9.tar.bz2
rails-e765bff13484b3c834f0e9979550196898dc7cc9.zip
Use `Array#extract!` where possible
Diffstat (limited to 'railties/lib/rails/api')
-rw-r--r--railties/lib/rails/api/generator.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/rails/api/generator.rb b/railties/lib/rails/api/generator.rb
index 3405560b74..126d4d0438 100644
--- a/railties/lib/rails/api/generator.rb
+++ b/railties/lib/rails/api/generator.rb
@@ -1,6 +1,7 @@
# frozen_string_literal: true
require "sdoc"
+require "active_support/core_ext/array/extract"
class RDoc::Generator::API < RDoc::Generator::SDoc # :nodoc:
RDoc::RDoc.add_generator self
@@ -11,7 +12,7 @@ class RDoc::Generator::API < RDoc::Generator::SDoc # :nodoc:
# since they aren't nested under a definition of the `ActiveStorage` module.
if visited.empty?
classes = classes.reject { |klass| active_storage?(klass) }
- core_exts, classes = classes.partition { |klass| core_extension?(klass) }
+ core_exts = classes.extract! { |klass| core_extension?(klass) }
super.unshift([ "Core extensions", "", "", build_core_ext_subtree(core_exts, visited) ])
else