lk | client completion date is merged into client pickup date

This commit is contained in:
Louis Knapp
2015-12-05 17:01:57 -06:00
parent ad76766402
commit f694d8c238
12 changed files with 15 additions and 28 deletions
-7
View File
@@ -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])
+5 -2
View File
@@ -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,