mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Docs: Fix output representation [ci skip]
The output of two string attributes is displayed differently in the docs. Standardize the output by always showing it as a comment.
This commit is contained in:
parent
763ef6d2fa
commit
ea2850b96a
1 changed files with 2 additions and 2 deletions
|
@ -19,10 +19,10 @@ module ActiveModel
|
|||
# cat = Cat.new
|
||||
# cat.assign_attributes(name: "Gorby", status: "yawning")
|
||||
# cat.name # => 'Gorby'
|
||||
# cat.status => 'yawning'
|
||||
# cat.status # => 'yawning'
|
||||
# cat.assign_attributes(status: "sleeping")
|
||||
# cat.name # => 'Gorby'
|
||||
# cat.status => 'sleeping'
|
||||
# cat.status # => 'sleeping'
|
||||
def assign_attributes(new_attributes)
|
||||
if !new_attributes.respond_to?(:stringify_keys)
|
||||
raise ArgumentError, "When assigning attributes, you must pass a hash as an argument."
|
||||
|
|
Loading…
Reference in a new issue