It will throw a urlError (function in backbone) if the model has a
collection and the collection has no URL, or it has no collection and no
urlRoot. We can proceed without a URL since we are just checking for
existence. Jeremy insists this getter must throw without an option to
suppress.

On Wednesday, January 2, 2013, Kevin Decker wrote:

> In src/model.js:
>
> > @@ -17,6 +17,17 @@ Thorax.Model = Backbone.Model.extend({
> >      }
> >      var keys = _.keys(attributes);
> >      return keys.length > 1 || (keys.length === 1 && keys[0] !== this.idAttribute);
> > +  },
> > +  shouldFetch: function(options) {
> > +    // TODO: if https://github.com/documentcloud/backbone/pull/2057 is merged
> > +    // then add {silent: true} to url call
> > +    var url;
> > +    try {
> > +      url = this.url();
> > +    } catch(e) {
> > +      url = false;
> > +    }
>
> Can you walk me through this try/catch? What is it doing, why is it there?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/walmartlabs/thorax/pull/90/files#r2532086>.
>
>