normalize article and category attributes (closes foodcoops#294)
This commit is contained in:
parent
7c2ecd8658
commit
a43020463d
5 changed files with 18 additions and 0 deletions
|
|
@ -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) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue