Allow input of decimal numbers for GroupOrderArticle-result.

This commit is contained in:
Benjamin Meichsner 2009-04-05 15:23:21 +02:00
parent 40886b71f9
commit 36f9bffdb8
3 changed files with 48 additions and 30 deletions

View file

@ -31,6 +31,11 @@ class GroupOrderArticle < ActiveRecord::Base
attr_accessor :ordergroup_id # To create an new GroupOrder if neccessary
named_scope :ordered, :conditions => 'result > 0'
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
def result=(result)
self[:result] = String.delocalized_decimal(result)
end
# Updates the quantity/tolerance for this GroupOrderArticle by updating both GroupOrderArticle properties
# and the associated GroupOrderArticleQuantities chronologically.