Closed hyperloop-rails closed 6 years ago
https://github.com/drhenner/ror_ecommerce/blob/3db5a29000ac93d6b896469511004e450d019042/app/controllers/shopping/billing_addresses_controller.rb#L67-L68
since only address.id is used later, so it can be improved as:
address = current_user.addresses.find(params[:id]) address.id should be equal to the params[:id], there is no need for the code current_user.addresses.find(params[:id])
address = current_user.addresses.find(params[:id])
address.id
current_user.addresses.find(params[:id])
https://github.com/drhenner/ror_ecommerce/blob/3db5a29000ac93d6b896469511004e450d019042/app/controllers/shopping/billing_addresses_controller.rb#L67-L68
since only address.id is used later, so it can be improved as:
address = current_user.addresses.find(params[:id])
address.id
should be equal to the params[:id], there is no need for the codecurrent_user.addresses.find(params[:id])