instance method _merge_validates_options

Ruby on Rails edge

Since edge Private — implementation detail, not part of the public API

Signature

_merge_validates_options(defaults, validator_options)

No documentation comment.

Parameters

defaults req
validator_options req
Source
# File activemodel/lib/active_model/validations/validates.rb, line 182
      def _merge_validates_options(defaults, validator_options)
        defaults.merge(validator_options) do |key, default_val, validator_val|
          if key == :if || key == :unless || key == :on
            Array(default_val) + Array(validator_val)
          else
            validator_val
          end
        end
      end

Defined in activemodel/lib/active_model/validations/validates.rb line 182 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveModel::Validations::ClassMethods

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close