app/models/form_item.rb
# All questionings that can be referred to by a condition if it were defined on this item.
All questionings that can be referred to by a condition if it were defined on this item.
All questionings that can be referred to by a condition if it were defined on this item .
def refable_qings(eager_load: nil)
    eager_load = eager_load ? [eager_load, :question] : :question
    all_items =
      if form
        form.preordered_items(eager_load: eager_load)
      else
        mission.forms.map { |form| form.preordered_items(eager_load: eager_load) }.flatten
      end
    all_previous = persisted? ? all_items[0..(all_items.index(self))] : all_items
    all_previous.select(&:refable?)
  end
def refable_qings ( eager_load : nil ) eager_load = eager_load ? [ eager_load , :question ] : :question all_items = if form form . preordered_items ( eager_load : eager_load ) else mission . forms . map { | form | form . preordered_items ( eager_load : eager_load ) } . flatten end all_previous = persisted? ? all_items [ 0 .. ( all_items . index ( self ) ) ] : all_items all_previous . select ( & :refable? ) end
All questionings that can be referred to by a condition if it were defined on this item.
All questionings that can be referred to by a condition if it were defined on this item .
# Always eager load :question because it's always needed # If no form specified, return all items for all forms.
eager_load
<not_specific>