method

init_with

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActiveModel::Errors
init_with(coder) 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/errors.rb, line 552
    def init_with(coder) # :nodoc:
      data = coder.map

      data.each { |k, v|
        next if LEGACY_ATTRIBUTES.include?(k.to_sym)
        instance_variable_set(:"@#{k}", v)
      }

      @errors ||= []

      # Legacy support Rails 5.x details hash
      add_from_legacy_details_hash(data["details"]) if data.key?("details")
    end
Register or log in to add new notes.