Refactor for authorization sanity

This commit is contained in:
2015-02-19 16:29:17 +01:00
parent a1474e934a
commit 5b3c1a9007
22 changed files with 190 additions and 80 deletions
@@ -2,6 +2,8 @@ attr = DS.attr
App.Employee= DS.Model.extend Ember.Validations.Mixin,
name: attr 'string'
email: attr 'string'
manager: attr 'boolean', defaultValue: false
active: attr 'boolean', defaultValue: true
validations:
name: {presence: true}
@@ -45,11 +45,11 @@ App.List = DS.Model.extend
).property('state', 'orders.@each.state')
close: ->
@markClosed()
$.post Routes.supplier_close_list_path(), list_id: @id
$.post Routes.close_suppliers_list_pat(@id)
is_helped: ->
@markHelped()
$.post Routes.supplier_mark_list_as_helped_path(), list_id: @id
$.post Routes.mark_helped_suppliers_list_path(@id)
remove_needs_payment: ->
@set 'needs_payment', false
$.post Routes.supplier_remove_list_needs_payment_path(), list_id: @id