Allow searching for deleted pools
This commit is contained in:
@@ -14,7 +14,7 @@ class PoolsController < ApplicationController
|
||||
end
|
||||
|
||||
def index
|
||||
@pools = Pool.undeleted.search(params[:search]).order("updated_at desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
|
||||
@pools = Pool.search(params[:search]).order("updated_at desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
|
||||
respond_with(@pools) do |format|
|
||||
format.xml do
|
||||
render :xml => @pools.to_xml(:root => "pools")
|
||||
|
||||
@@ -84,6 +84,12 @@ class Pool < ActiveRecord::Base
|
||||
q = q.collection
|
||||
end
|
||||
|
||||
if params[:is_deleted] == "true"
|
||||
q = q.deleted
|
||||
else
|
||||
q = q.undeleted
|
||||
end
|
||||
|
||||
q
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,6 +17,9 @@
|
||||
</td>
|
||||
<td>
|
||||
<%= link_to pool.pretty_name, pool_path(pool) %>
|
||||
<% if pool.is_deleted? %>
|
||||
<span class="inactive">(deleted)</span>
|
||||
<% end %>
|
||||
|
||||
<% if pool.post_count > CurrentUser.user.per_page %>
|
||||
<%= link_to "page #{pool.last_page}", pool_path(pool, :page => pool.last_page), :class => "last-page" %>
|
||||
|
||||
Reference in New Issue
Block a user