You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
436 B
16 lines
436 B
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
|
|
|
|
def name
|
|
self.first_name + ' ' + self.last_name
|
|
end
|
|
|
|
end
|
|
|