def finder_options(options = {})
      search_conditions = all_conditions

      # create a general-use options array that's compatible with Rails finders
      finder_options = {
        :reorder => options[:sorting]&.clause((grouped_columns_calculations if grouped_search?)),
        :conditions => search_conditions
      }
      if active_scaffold_config.mongoid?
        finder_options[:includes] = [active_scaffold_references, active_scaffold_preload].compact.flatten.uniq.presence
      else
        finder_options.merge!(
          :joins => joins_for_finder,
          :left_joins => active_scaffold_outer_joins,
          :preload => active_scaffold_preload,
          :includes => active_scaffold_references.presence,
          :references => active_scaffold_references.presence,
          :select => options[:select]
        )
      end

      finder_options.merge! custom_finder_options
      finder_options
    end
def finder_options(options = {})
      search_conditions = all_conditions

      # create a general-use options array that's compatible with Rails finders
      finder_options = {
        :reorder => options[:sorting]&.clause((grouped_columns_calculations if grouped_search?)),
        :conditions => search_conditions
      }
      if active_scaffold_config.mongoid?
        finder_options[:includes] = [active_scaffold_references, active_scaffold_preload].compact.flatten.uniq.presence
      else
        finder_options.merge!(
          :joins => joins_for_finder,
          :left_joins => active_scaffold_outer_joins,
          :preload => active_scaffold_preload,
          :includes => active_scaffold_references.presence,
          :references => active_scaffold_references.presence,
          :select => options[:select]
        )
      end

      finder_options.merge! custom_finder_options
      finder_options
    end
valid options may include:
 * :sorting - a Sorting DataStructure (basically an array of hashes of field => direction,
     e.g. [{:field1 => 'asc'}, {:field2 => 'desc'}]).
     please note that multi-column sorting has some limitations: if any column in a multi-field
     sort uses method-based sorting, it will be ignored. method sorting only works for single-column sorting.
 * :per_page
 * :page