Return true on default for product isValid

This commit is contained in:
2014-11-28 16:13:03 +01:00
parent aa003a382a
commit 11e0fd9abf
3 changed files with 3 additions and 0 deletions
@@ -20,4 +20,5 @@ App.Product = DS.Model.extend
isValid: (-> isValid: (->
return false unless price = @get('price') return false unless price = @get('price')
return false unless "#{price}".match(/^[+-]?\d+(\.?\d?\d)?$/) return false unless "#{price}".match(/^[+-]?\d+(\.?\d?\d)?$/)
true
).property('price') ).property('price')
@@ -1,5 +1,6 @@
module Suppliers module Suppliers
class ProductCategoriesController < Suppliers::ApplicationController class ProductCategoriesController < Suppliers::ApplicationController
layout 'tablet'
# GET /product_categories # GET /product_categories
# GET /product_categories.json # GET /product_categories.json
@@ -1,5 +1,6 @@
module Suppliers module Suppliers
class ProductsController < Suppliers::ApplicationController class ProductsController < Suppliers::ApplicationController
layout 'tablet'
# GET /products # GET /products
# GET /products.json # GET /products.json