If I used just order.customer is ko'd and crashed on itself :/


On Mon, Sep 30, 2013 at 2:35 PM, David Underwood
<notifications@github.com>wrote:

> In lib/generators/shopify_app/templates/app/controllers/home_controller.rb:
>
> > @@ -14,5 +14,12 @@ def index
> >      # get latest 5 orders
> >      @orders   = ShopifyAPI::Order.find(:all, :params => {:limit => 5, :order => "created_at DESC" })
> >    end
> > +
> > +  def customer_name(order)
> > +    name = ''
> > +    name += [order.customer.first_name, order.customer.last_name].join(" ") if order.respond_to?(:customer)
>
> Do we need the respond_to? here? you should just be able to do if
> order.customer, I think. It'll return nil if there's no customer and
> since nil is falsy, it'l fall through and not try to populate the name.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Shopify/shopify_app/pull/66/files#r6666416>
> .
>