app/models/section.rb
#a generated_section is available for a user to answer if it has no loop_item_type, or if its loop_item_type is not a filtering field
# or if its loop_item is part of the user's loop_items.
a generated_section is available for a user to answer if it has no loop_item_type, or if its loop_item_type is not a filtering field
or if its loop_item is part of the user's loop_items.
a generated_section is available for a user to answer if it has no loop_item_type or if its loop_item_type is not a filtering field or if its loop_item is part of the user ' s loop_items .
def available_for? user, loop_item
    return true if !self.loop_item_type.present? || !self.loop_item_type.is_filtering_field?
    obj = UserFilteringField.find_by_user_id_and_filtering_field_id(user.id, self.loop_item_type.filtering_field.id)
    if obj
      obj.field_value.downcase.strip == loop_item.item_name.downcase.strip
    else
      return false
    end
  end
def available_for? user , loop_item return true if ! self . loop_item_type . present? || ! self . loop_item_type . is_filtering_field? obj = UserFilteringField . find_by_user_id_and_filtering_field_id ( user . id , self . loop_item_type . filtering_field . id ) if obj obj . field_value . downcase . strip == loop_item . item_name . downcase . strip else return false end end
a generated_section is available for a user to answer if it has no loop_item_type, or if its loop_item_type is not a filtering field
or if its loop_item is part of the user's loop_items.
a generated_section is available for a user to answer if it has no loop_item_type or if its loop_item_type is not a filtering field or if its loop_item is part of the user ' s loop_items .
user
loop_item