Just needs a few validations and cleanup

MONDAY MADE ME SO ANGRY HAHAHAHAHAHAHA

On Thu, Oct 16, 2014 at 12:01 PM, Peter <notifications@github.com> wrote:

> In app/controllers/admin/orders_controller.rb:
>
> > +  end
> > +
> > +  def destroy
> > +    session[:return_to] ||= request.referer
> > +    if Order.find(params[:id]).destroy
> > +      flash[:success] = "Deleted."
> > +      redirect_to action: :index
> > +    else
> > +      flash[:error] = "Something went wrong in that deletion."
> > +      redirect_to session.delete(:return_to)
> > +    end
> > +  end
> > +
> > +  private
> > +
> > +  def add_contents
>
> This is a beast! I bet you'd write this very differently after this week :)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/vikingeducation/viking_store_admin/pull/1/files#r18978172>
> .
>



-- 

*Michael Alexander*

(310) 429-8822

alexandermw@gmail.com