created item groups and link banners and their associations and fixed bugs with join tables
This commit is contained in:
@@ -3,7 +3,7 @@ class Item < ActiveRecord::Base
|
||||
has_many :multi_media_descriptions
|
||||
belongs_to :sub_category
|
||||
belongs_to :supplier
|
||||
belongs_to :special_offer
|
||||
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
|
||||
|
||||
|
||||
4
back-office/app/models/item_group.rb
Normal file
4
back-office/app/models/item_group.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class ItemGroup < ActiveRecord::Base
|
||||
has_and_belongs_to_many :items, :join_table => 'item_item_groups'
|
||||
|
||||
end
|
||||
@@ -1,5 +1,5 @@
|
||||
class SpecialOffer < ActiveRecord::Base
|
||||
belongs_to :item
|
||||
class LinkBanner < ActiveRecord::Base
|
||||
|
||||
belongs_to :category
|
||||
belongs_to :section
|
||||
belongs_to :sub_category
|
||||
Reference in New Issue
Block a user