Skip to content

Commit

Permalink
Ensure invoices exist for project on new invoice route
Browse files Browse the repository at this point in the history
  • Loading branch information
watsonbox committed Dec 30, 2014
1 parent d27e2a8 commit 70b1a9d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/assets/javascripts/routes/invoices_new_route.js.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Facture.InvoicesNewRoute = Ember.Route.extend
model: ->
@modelFor('project').newInvoice()
# Seems we must ensure the invoices exist or the invoice is not properly associated
project = @modelFor('project')
project.get('invoices').then -> project.newInvoice()

renderTemplate: ->
@render('invoice.edit', {
Expand Down

0 comments on commit 70b1a9d

Please sign in to comment.