normalize article and category attributes (closes foodcoops#294)

This commit is contained in:
wvengen 2014-06-06 16:41:01 +02:00
parent 7c2ecd8658
commit a43020463d
5 changed files with 18 additions and 0 deletions

View file

@ -45,6 +45,8 @@ class Article < ActiveRecord::Base
# Replace numeric seperator with database format
localize_input_of :price, :tax, :deposit
# Get rid of unwanted whitespace. {Unit#new} may even bork on whitespace.
normalize_attributes :name, :unit, :note, :manufacturer, :origin, :order_number
scope :undeleted, -> { where(deleted_at: nil) }
scope :available, -> { undeleted.where(availability: true) }