diff --git a/app/controllers/vehicles_controller.rb b/app/controllers/vehicles_controller.rb index 7d879dc..03bdf81 100644 --- a/app/controllers/vehicles_controller.rb +++ b/app/controllers/vehicles_controller.rb @@ -54,7 +54,9 @@ class VehiclesController < ApplicationController def edit begin @vehicle = Vehicle.find_by_id(params[:id]) - @customers = Customer.without_callback(:initialize, :after, :pull).all.order(:name) + Customer.without_callback(:initialize, :after, :pull) do + @customers = .all.order(:name) + end rescue ActiveRecord::RecordNotFound render_404 end