items are functional for now
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
class ItemsController < ApplicationController
|
class ItemsController < ApplicationController
|
||||||
active_scaffold :"item" do |conf|
|
active_scaffold :"item" do |conf|
|
||||||
conf.columns[:unit].form_ui = :select
|
conf.columns[:unit].form_ui = :select
|
||||||
|
conf.columns[:sub_category].form_ui = :select
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
class Item < ActiveRecord::Base
|
class Item < ActiveRecord::Base
|
||||||
belongs_to :unit
|
belongs_to :unit
|
||||||
has_many :multi_media_descriptions
|
has_many :multi_media_descriptions
|
||||||
|
belongs_to :sub_category
|
||||||
|
|
||||||
validates_presence_of :name, :description, :list_price, :current_input_price, :tags, :unit_id, :code
|
validates_presence_of :name, :description, :list_price, :current_input_price, :tags, :unit_id, :code, :sub_category_id
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
class MultiMediaDescription < ActiveRecord::Base
|
class MultiMediaDescription < ActiveRecord::Base
|
||||||
belongs_to :item
|
belongs_to :item
|
||||||
belongs_to :media_type
|
belongs_to :media_type
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
class SubCategory < ActiveRecord::Base
|
class SubCategory < ActiveRecord::Base
|
||||||
belongs_to :category
|
belongs_to :category
|
||||||
|
has_many :items
|
||||||
|
belongs_to :sub_category
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user