Skip to content

Commit 5de585e

Browse files
Merge pull request rails#49456 from seanpdoyle/strong-parameters-deep-merge-rdoc
Fix `ActionController::Parameters#deep_merge` RDoc [ci skip]
2 parents 832fb1d + 5c3cb9f commit 5de585e

File tree

1 file changed

+26
-22
lines changed

1 file changed

+26
-22
lines changed

actionpack/lib/action_controller/metal/strong_parameters.rb

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,31 @@ class Parameters
144144

145145
cattr_accessor :action_on_unpermitted_parameters, instance_accessor: false
146146

147+
##
148+
# :method: deep_merge
149+
#
150+
# :call-seq:
151+
# deep_merge(other_hash, &block)
152+
#
153+
# Returns a new +ActionController::Parameters+ instance with +self+ and +other_hash+ merged recursively.
154+
#
155+
# Like with <tt>Hash#merge</tt> in the standard library, a block can be provided
156+
# to merge values.
157+
#
158+
#--
159+
# Implemented by ActiveSupport::DeepMergeable#deep_merge.
160+
161+
##
162+
# :method: deep_merge!
163+
#
164+
# :call-seq:
165+
# deep_merge!(other_hash, &block)
166+
#
167+
# Same as +#deep_merge+, but modifies +self+.
168+
#
169+
#--
170+
# Implemented by ActiveSupport::DeepMergeable#deep_merge!.
171+
147172
##
148173
# :method: as_json
149174
#
@@ -866,28 +891,7 @@ def merge!(other_hash, &block)
866891
self
867892
end
868893

869-
##
870-
# :method: deep_merge
871-
# :call-seq: deep_merge(other_hash, &block)
872-
#
873-
# Returns a new +ActionController::Parameters+ instance with +self+ and +other_hash+ merged recursively.
874-
#
875-
# Like with +Hash#merge+ in the standard library, a block can be provided
876-
# to merge values.
877-
#
878-
#--
879-
# Implemented by ActiveSupport::DeepMergeable#deep_merge.
880-
881-
##
882-
# :method: deep_merge!
883-
# :call-seq: deep_merge!(other_hash, &block)
884-
#
885-
# Same as +#deep_merge+, but modifies +self+.
886-
#
887-
#--
888-
# Implemented by ActiveSupport::DeepMergeable#deep_merge!.
889-
890-
def deep_merge?(other_hash) # :nodoc
894+
def deep_merge?(other_hash) # :nodoc:
891895
other_hash.is_a?(ActiveSupport::DeepMergeable)
892896
end
893897

0 commit comments

Comments
 (0)