item groups now have order - start page is now item group 1 (configurable in globals)
This commit is contained in:
@@ -5,7 +5,7 @@ class Item < ActiveRecord::Base
|
||||
belongs_to :supplier
|
||||
belongs_to :brand
|
||||
belongs_to :delivery_time_estimation
|
||||
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
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class ItemGroup < ActiveRecord::Base
|
||||
has_and_belongs_to_many :items, :join_table => 'item_item_groups'
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
8
back-office/app/models/item_in_group.rb
Normal file
8
back-office/app/models/item_in_group.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class ItemInGroup < ActiveRecord::Base
|
||||
belongs_to :item_group
|
||||
belongs_to :item
|
||||
|
||||
validates_presence_of :item_group_id
|
||||
validates_presence_of :item_id
|
||||
validates_presence_of :position
|
||||
end
|
||||
Reference in New Issue
Block a user