Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions app/controllers/checkouts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def index
end
end

search.build do
with(:checked_in_at).equal_to nil
end
#search.build do
# with(:checked_in_at).equal_to nil
#end
end

if current_user.try(:has_role?, 'Librarian')
Expand Down Expand Up @@ -92,11 +92,13 @@ def index
end
search.build do
with(:reserved).equal_to reserved
with(:checked_in_at).equal_to nil
end
end

search.build do
order_by :created_at, :desc
order_by :returned, :desc
order_by :due_date, :desc
facet :reserved
end
page = params[:page] || 1
Expand Down
3 changes: 3 additions & 0 deletions app/models/checkout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ class Checkout < ActiveRecord::Base
boolean :reserved do
reserved?
end
boolean :returned do
checkin.nil?
end
end

attr_accessor :operator
Expand Down