tap/app/models/barcode.rb

18 lines
386 B
Ruby
Raw Normal View History

2015-09-23 11:09:24 +02:00
# == Schema Information
#
# Table name: barcodes
#
# id :integer not null, primary key
# product_id :integer
# code :string default(""), not null
# created_at :datetime
# updated_at :datetime
#
class Barcode < ActiveRecord::Base
belongs_to :product
# validates :product, presence: true
validates :code, presence: true, uniqueness: true
2015-09-23 11:09:24 +02:00
end