end of day commit

This commit is contained in:
2012-08-28 20:08:13 +02:00
parent 0b16614d41
commit 89700f36e9
43 changed files with 896 additions and 26 deletions
+13
View File
@@ -10,6 +10,9 @@ class Supplier
has_many :tables, dependent: :destroy
#has_many :lists, through: :tables
has_many :orders
has_many :sections, dependent: :destroy
after_create :add_section_on_create
def active_orders
return @active_orders if @active_orders
@@ -31,4 +34,14 @@ class Supplier
tables
end
def non_placed_tables
tables.reject{|t| t.section_id.present? }
end
private
def add_section_on_create
@section = Section.create supplier: self, title: I18n.t('section.first_section_title')
end
end