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:
@@ -67,13 +67,6 @@ class BikesController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def mark_picked_up
|
||||
@bike = Bike.find(params[:id])
|
||||
@bike.mark_picked_up
|
||||
flash[:notice] = @bike.name + ' was marked as picked up'
|
||||
redirect_to action: "ready_for_pickup", controller: "freecyclery"
|
||||
end
|
||||
|
||||
private
|
||||
def set_bike
|
||||
@bike = Bike.find(params[:id])
|
||||
|
||||
@@ -24,7 +24,11 @@ class ClientsController < ApplicationController
|
||||
|
||||
def update
|
||||
if @client.update(client_params)
|
||||
redirect_to edit_client_url(@client), notice: 'Client was successfully updated.'
|
||||
notice = 'Client was successfully updated.'
|
||||
unless @client.bike.update_attribute(:date_sold, @client.pickup_date)
|
||||
notice = "Unable to update client's bike sale date"
|
||||
end
|
||||
redirect_to edit_client_url(@client), notice: notice
|
||||
else
|
||||
render action: 'edit'
|
||||
end
|
||||
@@ -46,7 +50,6 @@ class ClientsController < ApplicationController
|
||||
:weight,
|
||||
:helmet,
|
||||
:lock,
|
||||
:completion_date,
|
||||
:bike_id,
|
||||
:will_pay,
|
||||
:bike_type_requested,
|
||||
|
||||
Reference in New Issue
Block a user