15 lines
282 B
Ruby
15 lines
282 B
Ruby
class ProductCategory
|
|
include SimplyStored::Couch
|
|
|
|
property :name
|
|
property :position, type: Fixnum, default: 0
|
|
|
|
belongs_to :supplier
|
|
has_many :products
|
|
|
|
attr_protected :supplier_id
|
|
|
|
validates :position, numericality: true
|
|
validates :supplier_id, presence: true
|
|
end
|