Skip to content

Instantly share code, notes, and snippets.

@freemarmoset
Created December 2, 2009 21:12
Show Gist options
  • Save freemarmoset/247590 to your computer and use it in GitHub Desktop.
Save freemarmoset/247590 to your computer and use it in GitHub Desktop.
def set_cart_to_current_customers()
@cart = current_customer.carts.find_by_cart_reference(params[:id])
return cart_access_denied unless @cart
end
def cart_access_denied
flash[:error] = "You are in an inconsistent customer state. As customer ##{current_customer.account_detail.customer_number} you are attemping to alter cart ##{params[:id]}"
redirect_to kehe_direct_home_path
false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment