Add push buttons and support inactive products

This commit is contained in:
2015-03-24 14:53:02 +01:00
parent b0bab98be8
commit e720d6b31c
22 changed files with 74 additions and 21 deletions
@@ -1,10 +1,11 @@
attr = DS.attr
App.Product = DS.Model.extend Ember.Validations.Mixin,
name: attr 'string'
price: attr 'number'
price: attr 'number', defaultValue: 0
code: attr 'string'
description: attr 'string'
visible: attr('boolean', defaultValue: true)
active: attr('boolean', defaultValue: true)
position: attr('number', defaultValue: 0)
image: attr()
product_category: DS.belongsTo('product_category')
@@ -23,5 +24,8 @@ App.Product = DS.Model.extend Ember.Validations.Mixin,
#true
#).property('price')
validations:
name: {presence: true}
price: {format: /^[+-]?\d+(\.?\d?\d)?$/}
name:
presence: true
price:
format:
width: /^[+-]?\d*(\.?\d?\d)?$/