method

to_h

rails latest stable - Class: ActiveModel::Errors

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v6.1.7.7) is shown here.

to_h()
public

No documentation available.

# 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