Class: Serega::SeregaValidations::Attribute::CheckOptPreloadPath

Inherits:
Object
  • Object
show all
Defined in:
lib/serega/validations/attribute/check_opt_preload_path.rb

Overview

Validator for attribute :preload_path option

Class Method Summary collapse

Class Method Details

.call(opts) ⇒ void

This method returns an undefined value.

Checks preload_path option

Raises:



20
21
22
23
24
25
26
27
28
# File 'lib/serega/validations/attribute/check_opt_preload_path.rb', line 20

def call(opts)
  return if exactly_nil?(opts, :preload_path) # allow to provide nil anyway

  path = opts[:preload_path]
  check_usage_with_other_options(path, opts)
  return unless opts[:serializer]

  check_allowed(path, opts)
end