1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.

12 lines
307 B
Ruby

class Unit < ActiveRecord::Base
belongs_to :project, required: false
validates :shortname, presence: true, uniqueness: {scope: :project_id}
# Has to go before any 'dependent:' association
before_destroy do
# FIXME: disallow destruction if any object depends on this quantity
nil
end
end