instance method to_h

Ruby on Rails 6.1.7.10

Since v6.1.7.10 Last seen in v6.1.7.10

Signature

to_h()

No documentation comment.

Source
# File activemodel/lib/active_model/errors.rb, line 326
    def to_h
      ActiveSupport::Deprecation.warn(<<~EOM)
        ActiveModel::Errors#to_h is deprecated and will be removed in Rails 7.0.
        Please use `ActiveModel::Errors.to_hash` instead. The values in the hash
        returned by `ActiveModel::Errors.to_hash` is an array of error messages.
      EOM

      to_hash.transform_values { |values| values.last }
    end

Defined in activemodel/lib/active_model/errors.rb line 326 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveModel::Errors

Type at least 2 characters to search.

↑↓ navigate · open · esc close