|
@ -8,7 +8,8 @@ class Client < ActiveRecord::Base |
|
|
clients = Client.all |
|
|
clients = Client.all |
|
|
non_voided_clients = clients.select{|client| !client.application_voided} |
|
|
non_voided_clients = clients.select{|client| !client.application_voided} |
|
|
waiting_list_with_null_application_dates = non_voided_clients.select{|client| !client.completion_date} |
|
|
waiting_list_with_null_application_dates = non_voided_clients.select{|client| !client.completion_date} |
|
|
waiting_list = waiting_list_with_null_application_dates.select{|client| !client.application_date.nil?} |
|
|
clients_with_bikes = Client.all.select{|c| !c.bike_id.nil?} |
|
|
|
|
|
waiting_list = waiting_list_with_null_application_dates.select{|client| !client.application_date.nil?} - clients_with_bikes |
|
|
waiting_list.sort_by!{|client| client.application_date} |
|
|
waiting_list.sort_by!{|client| client.application_date} |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|