app/controllers/homepage_controller.rb
def select_relevant_filters(category_ids)
    relevant_filters =
      if category_ids.present?
        @current_community
          .custom_fields
          .joins(:category_custom_fields)
          .where("category_custom_fields.category_id": category_ids, search_filter: true)
          .distinct
      else
        @current_community
          .custom_fields.where(search_filter: true)
      end

    relevant_filters.sort
  end
# Database select for "relevant" filters based on the `category_ids`
#
# If `category_ids` is present, returns only filter that belong to
# one of the given categories. Otherwise returns all filters.
#
Database select for "relevant" filters based on the `category_ids`
If `category_ids` is present, returns only filter that belong to
one of the given categories. Otherwise returns all filters.
Database select for " relevant " filters based on the ` category_ids ` If ` category_ids ` is present returns only filter that belong to one of the given categories . Otherwise returns all filters .
def select_relevant_filters(category_ids)
    relevant_filters =
      if category_ids.present?
        @current_community
          .custom_fields
          .joins(:category_custom_fields)
          .where("category_custom_fields.category_id": category_ids, search_filter: true)
          .distinct
      else
        @current_community
          .custom_fields.where(search_filter: true)
      end
    relevant_filters.sort
  end
def select_relevant_filters ( category_ids ) relevant_filters = if category_ids . present? @current_community . custom_fields . joins ( :category_custom_fields ) . where ( "category_custom_fields.category_id" : category_ids , search_filter : true ) . distinct else @current_community . custom_fields . where ( search_filter : true ) end relevant_filters . sort end
Database select for "relevant" filters based on the `category_ids`
If `category_ids` is present, returns only filter that belong to
one of the given categories.
Database select for " relevant " filters based on the ` category_ids ` If ` category_ids ` is present returns only filter that belong to one of the given categories .
category_ids