def default_scope(params = nil)
      params ||= @request_params
      
      scope = model.sunrise_search(params[:search]) if model.respond_to?(:sunrise_search) && !params[:search].blank?
      scope ||= model.where(nil)
      
      scope = scope.merge(association_scope) unless parent_record.nil?
      scope = scope.merge(sort_scope(params[:sort])) unless params[:sort].blank?
      scope = scope.merge(list.scope) unless list.scope.nil?
      
      scope
    end
def default_scope(params = nil)
      params ||= @request_params
      
      scope = model.sunrise_search(params[:search]) if model.respond_to?(:sunrise_search) && !params[:search].blank?
      scope ||= model.where(nil)
      
      scope = scope.merge(association_scope) unless parent_record.nil?
      scope = scope.merge(sort_scope(params[:sort])) unless params[:sort].blank?
      scope = scope.merge(list.scope) unless list.scope.nil?
      
      scope
    end
Apply default scopes: sort, search and association.