Add push buttons and support inactive products
This commit is contained in:
@@ -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)?$/
|
||||
|
||||
Reference in New Issue
Block a user