Skip to content

Commit c8b3642

Browse files
Ensure AR::Core#{slice,values_at} appear in RDoc [ci-skip]
When a `:method:` doc is immediately followed by the `private` keyword, RDoc will hide that doc as if it were a private method. In rails#48324, the `:method:` docs for `ActiveRecord::Core#slice` and `ActiveRecord::Core#values_at` were swapped in an attempt to force `values_at` to appear in the rendered docs. However, doing so causes `slice` to dissappear from the rendered docs. To ensure that `slice` and `values_at` both appear in the rendered docs, this commit moves their `:method:` docs away from the `private` keyword in `ActiveRecord::Core`.
1 parent 6df4d3b commit c8b3642

File tree

1 file changed

+21
-21
lines changed
  • activerecord/lib/active_record

1 file changed

+21
-21
lines changed

activerecord/lib/active_record/core.rb

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,27 @@ def encode_with(coder)
536536
coder["active_record_yaml_version"] = 2
537537
end
538538

539+
##
540+
# :method: slice
541+
#
542+
# :call-seq: slice(*methods)
543+
#
544+
# Returns a hash of the given methods with their names as keys and returned
545+
# values as values.
546+
#
547+
#--
548+
# Implemented by ActiveModel::Access#slice.
549+
550+
##
551+
# :method: values_at
552+
#
553+
# :call-seq: values_at(*methods)
554+
#
555+
# Returns an array of the values returned by the given methods.
556+
#
557+
#--
558+
# Implemented by ActiveModel::Access#values_at.
559+
539560
# Returns true if +comparison_object+ is the same exact object, or +comparison_object+
540561
# is of the same type and +self+ has an ID and it is equal to +comparison_object.id+.
541562
#
@@ -701,27 +722,6 @@ def pretty_print(pp)
701722
end
702723
end
703724

704-
##
705-
# :method: values_at
706-
#
707-
# :call-seq: values_at(*methods)
708-
#
709-
# Returns an array of the values returned by the given methods.
710-
#
711-
#--
712-
# Implemented by ActiveModel::Access#values_at.
713-
714-
##
715-
# :method: slice
716-
#
717-
# :call-seq: slice(*methods)
718-
#
719-
# Returns a hash of the given methods with their names as keys and returned
720-
# values as values.
721-
#
722-
#--
723-
# Implemented by ActiveModel::Access#slice.
724-
725725
private
726726
# +Array#flatten+ will call +#to_ary+ (recursively) on each of the elements of
727727
# the array, and then rescues from the possible +NoMethodError+. If those elements are

0 commit comments

Comments
 (0)