mirror of
https://github.com/fspc/bike-database.git
synced 2026-09-16 08:31:39 -04:00
lk | client completion date is merged into client pickup date
This commit is contained in:
@@ -43,11 +43,6 @@ class Bike < ActiveRecord::Base
|
||||
all_freecyclery_bikes - assigned_bikes
|
||||
end
|
||||
|
||||
def mark_picked_up
|
||||
current_date = Time.new.strftime("%Y-%m-%d")
|
||||
self.update_attribute(:date_sold, current_date)
|
||||
end
|
||||
|
||||
def post_to_bike_index
|
||||
return true if self.bike_index_id.present?
|
||||
BikeIndexLogger.perform_async(self.id)
|
||||
|
||||
@@ -7,7 +7,7 @@ class Client < ActiveRecord::Base
|
||||
def self.waiting_list
|
||||
clients = Client.all
|
||||
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.pickup_date}
|
||||
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}
|
||||
@@ -18,7 +18,7 @@ class Client < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def self.closed_applications
|
||||
Client.all.select{|client| client.application_voided || client.completion_date}
|
||||
Client.all.select{|client| client.application_voided || client.pickup_date}
|
||||
end
|
||||
|
||||
def bike
|
||||
|
||||
Reference in New Issue
Block a user