class TbCommerce::OptionSet < ActiveRecord::Base self.table_name = 'tb_commerce_option_sets' validates :name, :presence => true has_many :options, :inverse_of => :option_set, :dependent => :destroy, :foreign_key => :tb_commerce_option_set_id has_many :product_option_sets, :inverse_of => :option_set, :dependent => :destroy, :foreign_key => :tb_commerce_option_set_id has_many :products, :through => :product_option_sets end