Created namespace 'finance' and moved invoices into it.

This commit is contained in:
Benjamin Meichsner 2009-01-10 19:36:58 +01:00
parent 30f3d199d3
commit 1d85b880f2
17 changed files with 163 additions and 133 deletions

View file

@ -21,6 +21,8 @@ class Invoice < ActiveRecord::Base
validates_presence_of :supplier_id
validates_uniqueness_of :date, :scope => [:supplier_id]
named_scope :unpaid, :conditions => { :paid_on => nil }
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
def amount=(amount)
self[:amount] = String.delocalized_decimal(amount)