Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Item < ActiveRecord::Base
- belongs_to :category
- validates_presence_of :category
- validates_presence_of :code
- validates_uniqueness_of :code
- validates_format_of :code, :with => /^[a-zA-Z]+-\d+$/
- end
Add Comment
Please, Sign In to add comment