kaiho/app/models/version.rb

6 lines
185 B
Ruby

class Version < ApplicationRecord
belongs_to :software
validates :number, presence: true
validates :date, presence: true
validates :number, uniqueness: { scope: :software }
end