created item groups and link banners and their associations and fixed bugs with join tables

This commit is contained in:
Senad Uka
2015-03-22 06:17:05 +01:00
parent 38548e3e33
commit bbedb4a877
20 changed files with 219 additions and 81 deletions

View File

@@ -0,0 +1,4 @@
class ItemGroupsController < ApplicationController
active_scaffold :"item_group" do |conf|
end
end

View File

@@ -0,0 +1,4 @@
class LinkBannersController < ApplicationController
active_scaffold :"link_banner" do |conf|
end
end

View File

@@ -1,4 +0,0 @@
class SpecialOffersController < ApplicationController
active_scaffold :"special_offer" do |conf|
end
end

View File

@@ -0,0 +1,2 @@
module ItemGroupsHelper
end

View File

@@ -0,0 +1,2 @@
module LinkBannersHelper
end

View File

@@ -1,2 +0,0 @@
module SpecialOffersHelper
end

View File

@@ -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

View File

@@ -0,0 +1,4 @@
class ItemGroup < ActiveRecord::Base
has_and_belongs_to_many :items, :join_table => 'item_item_groups'
end

View File

@@ -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