created item groups and link banners and their associations and fixed bugs with join tables
This commit is contained in:
4
back-office/app/controllers/item_groups_controller.rb
Normal file
4
back-office/app/controllers/item_groups_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class ItemGroupsController < ApplicationController
|
||||
active_scaffold :"item_group" do |conf|
|
||||
end
|
||||
end
|
||||
4
back-office/app/controllers/link_banners_controller.rb
Normal file
4
back-office/app/controllers/link_banners_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class LinkBannersController < ApplicationController
|
||||
active_scaffold :"link_banner" do |conf|
|
||||
end
|
||||
end
|
||||
@@ -1,4 +0,0 @@
|
||||
class SpecialOffersController < ApplicationController
|
||||
active_scaffold :"special_offer" do |conf|
|
||||
end
|
||||
end
|
||||
2
back-office/app/helpers/item_groups_helper.rb
Normal file
2
back-office/app/helpers/item_groups_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module ItemGroupsHelper
|
||||
end
|
||||
2
back-office/app/helpers/link_banners_helper.rb
Normal file
2
back-office/app/helpers/link_banners_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module LinkBannersHelper
|
||||
end
|
||||
@@ -1,2 +0,0 @@
|
||||
module SpecialOffersHelper
|
||||
end
|
||||
@@ -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