mirror of
https://github.com/fspc/bike-database.git
synced 2026-09-16 08:31:39 -04:00
Louis | Adds client waiting list to client list
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
class Client < ActiveRecord::Base
|
||||
has_one :bike
|
||||
belongs_to :agency
|
||||
|
||||
def self.waiting_list
|
||||
clients = Client.all
|
||||
non_voided_clients = clients.select{|client| !client.application_voided}
|
||||
incomplete_clients = non_voided_clients.select{|client| !client.completion_date}
|
||||
waiting_list = incomplete_clients.sort_by!{|client| client.application_date}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user