drhenner / ror_ecommerce

Ruby on Rails Ecommerce platform, perfect for your small business solution.
www.ror-e.com
MIT License
1.21k stars 409 forks source link

unused data retrieval #194

Closed hyperloop-rails closed 6 years ago

hyperloop-rails commented 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])