added brands

This commit is contained in:
Edin Dazdarevic
2015-03-28 14:38:15 +01:00
parent 6c7a1b962f
commit 71fbde93de
11 changed files with 35 additions and 5 deletions

View File

@@ -0,0 +1,3 @@
class Brand < ActiveRecord::Base
has_many :items
end

View File

@@ -3,6 +3,7 @@ class Item < ActiveRecord::Base
has_many :multi_media_descriptions
belongs_to :sub_category
belongs_to :supplier
belongs_to :brand
has_and_belongs_to_many :item_groups, :join_table => 'item_item_groups'
validates_presence_of :name, :description, :list_price, :current_input_price, :tags, :unit_id, :code, :sub_category_id, :weight, :supplier_id