method

on

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActiveModel::DeprecatedErrorMethods

Method deprecated or moved

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

These similar methods exist in v7.1.3.2:

on(attribute) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activemodel/lib/active_model/deprecated_error_methods.rb, line 3
    def on(attribute)
      message = "Errors#on have been deprecated, use Errors#[] instead.\n"
      message << "Also note that the behaviour of Errors#[] has changed. Errors#[] now always returns an Array. An empty Array is "
      message << "returned when there are no errors on the specified attribute."
      ActiveSupport::Deprecation.warn(message)

      errors = self[attribute]
      errors.size < 2 ? errors.first : errors
    end
Register or log in to add new notes.