Module: Avo::Fields::Concerns::IsRequired

Extended by:
ActiveSupport::Concern
Included in:
BaseField
Defined in:
lib/avo/fields/concerns/is_required.rb

Instance Method Summary collapse

Instance Method Details

#is_required?Boolean

Returns:

  • (Boolean)


7
8
9
10
11
# File 'lib/avo/fields/concerns/is_required.rb', line 7

def is_required?
  return required_from_validators if required.nil?

  Avo::ExecutionContext.new(target: required, record: record, view: view, resource: resource).handle
end