title: How to override build_query method in role_adapter rolify?
body: <p>I am using rolify gem for authorization. When i create a new user dynamically through UI, my users_roles (in my case role_user_map) table insert is not happening. Is there a way to override build_query method? Please, guide me with this. Thank You. `
   users_controller.rb</p>
  
  <pre><code>def index
      store_list = @query_stores.split(" ").join("','")
      profile_list = @profiles.map {|role| role.role_name}.join("','")
      if params[:search_by].present?
        search_by = params[:search_by]
        if current_user.admin? || current_user.radial_readonly?
          @users = User.distinct.joins('LEFT JOIN stores_users ON dim_user.user_id = stores_users.user_id')
                       .joins('LEFT JOIN stores ON stores.id = stores_users.store_id')
                       .joins('LEFT JOIN clients_users ON dim_user.user_id = clients_users.user_id')
                       .joins('LEFT JOIN clients ON clients_users.client_id = clients.id')
                       .joins(:DIM_ROLE)
                       .where('dim_user.full_name LIKE :search OR dim_user.email LIKE :search OR DIM_ROLE.role_name LIKE :search OR clients.code LIKE :search OR stores.code LIKE :search', search: "%#{search_by}%")
        else
          @users = User.distinct.joins(:store_user_assignments)
                       .joins(:stores)
                       .where("stores.code IN ('#{store_list}')")
                       .joins('LEFT JOIN clients_users ON dim_user.user_id = clients_users.user_id')
                       .joins('LEFT JOIN clients ON clients_users.client_id = clients.id')
                       .joins(:DIM_ROLE)
                       .where("DIM_ROLE.role_name IN ('#{profile_list}')")
                       .where('dim_user.full_name LIKE :search OR dim_user.email LIKE :search OR DIM_ROLE.role_name LIKE :search OR clients.code LIKE :search OR stores.code LIKE :search', search: "%#{search_by}%")
        end
      else
        if current_user.admin? || current_user.radial_readonly?
          @users = User.distinct.joins('LEFT JOIN stores_users ON dim_user.user_id = stores_users.store_id')
        else
          @users = User.distinct.joins(:store_user_assignments).joins(:DIM_ROLE).where("DIM_ROLE.role_name IN ('#{profile_list}')").joins(:stores).where("stores.code IN ('#{store_list}')")
        end
      end
  
      if current_user.pmt_ptl_accnt_manager?
        @users = @users.find_all {|user| !user.admin? and current_user.client_list.include? user.client_list}
      end
      # added @users_total to get the total users count before paginate
  =begin
      @users_total = @users
      @users = @users.paginate(:per_page =&gt; params[:per_page] || 5, :page =&gt; params[:page])
      @users_per_page = [{"name" =&gt; "5 per page", "id" =&gt; "5"},
                         {"name" =&gt; "10 per page", "id" =&gt; "10"},
                         {"name" =&gt; "15 per page", "id" =&gt; "15"},
                         {"name" =&gt; "20 per page", "id" =&gt; "20"}]
  =end
    end
  </code></pre>
  
  <p>`</p>