Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
- Fix loan issues due to production ruby version
Browse files Browse the repository at this point in the history
  • Loading branch information
Mebibyte committed Dec 13, 2017
1 parent 1423bfa commit 9c2eb28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/controllers/loaners_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def group_index
@group = Group.find(params[:id])
@loans_by_title_id = @group.active_loans.includes(:game).group_by{ |loan| loan.game.title_id }

if order = params[:order]&.split(',')&.map(&:to_i)
if order = params[:order]
order = order.split(',').map(&:to_i)
new_keys = @loans_by_title_id.keys - order
new_keys += order
@loans_by_title_id = new_keys.each_with_object({}) do |key, obj|
Expand Down
2 changes: 1 addition & 1 deletion app/models/loan.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ class Loan < ActiveRecord::Base

scope :active, -> { where(closed: false) }
scope :current, -> { where(event: Event.current) }
scope :by_check_out_time, -> (direction = :desc) { order(check_out_time: direction) }
scope :by_check_out_time, ->(direction=:desc) { order(check_out_time: direction) }
end

0 comments on commit 9c2eb28

Please sign in to comment.