Skip to content

Commit

Permalink
Use a less intractable sorting algorithm. Oddly enough, this seems to…
Browse files Browse the repository at this point in the history
… be partly related to the PDF bug. [#16]
  • Loading branch information
marnen committed Mar 15, 2009
1 parent 0c7a607 commit 56b2482
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/events_controller.rb
Expand Up @@ -22,7 +22,7 @@ class EventsController < ApplicationController
response_for :index do |format|
format.html
format.pdf do
@users = current_objects.blank? ? [] : current_objects[0].calendar.permissions.find_all_by_show_in_report(true, :include => :user).collect{|x| x.user}.sort{|x, y| s = ((x.lastname || x.email) <=> (y.lastname || y.email)); s == 0 ? ((x.firstname || x.email) <=> (y.firstname || y.email)) : s} # TODO: fix for multiple calendars
@users = current_objects.blank? ? [] : current_objects[0].calendar.permissions.find_all_by_show_in_report(true, :include => :user).collect{|x| x.user}.sort{|x, y| [x.lastname, x.firstname, x.email].compact <=> [y.lastname, y.firstname, y.email].compact} # TODO: fix for multiple calendars
prawnto :prawn => {:page_layout => :landscape}
render :layout => false
end
Expand Down

0 comments on commit 56b2482

Please sign in to comment.