Class: Avo::FieldsExecutionContext

Inherits:
ExecutionContext show all
Includes:
Concerns::HasItems
Defined in:
lib/avo/fields_execution_context.rb

Instance Attribute Summary

Attributes included from Concerns::HasItems

#items_holder

Attributes inherited from ExecutionContext

#avo, #context, #current_user, #include, #locale, #main_app, #params, #request, #target, #view_context

Instance Method Summary collapse

Methods included from Concerns::HasItems

#fields, #get_field, #get_field_definitions, #get_fields, #get_items, #get_preview_fields, #invalid_fields, #is_empty?, #items, #only_fields, #tab_groups, #visible_items

Methods inherited from ExecutionContext

#handle, #initialize

Methods included from Concerns::HasHelpers

#helpers

Constructor Details

This class inherits a constructor from Avo::ExecutionContext

Instance Method Details

#detect_fieldsObject



5
6
7
8
9
10
11
# File 'lib/avo/fields_execution_context.rb', line 5

def detect_fields
  self.items_holder = Avo::Resources::Items::Holder.new(parent: self)

  instance_exec(&target) if target.present? && target.respond_to?(:call)

  self
end