diff options
author | David Gay <david@davidgay.org> | 2021-05-20 18:25:35 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-20 18:25:35 -0400 |
commit | c25a079be25cc0aadf85119d97d8e1b9395b15fb (patch) | |
tree | 3c27d8b75323ae6f48be2a34d5f022a4c8b8b388 | |
parent | 71f15b6534ffa7ba159d5e4076d59bb7961089a9 (diff) |
Add uniqueness scope constraint to BuiltHearthAmenity
-rw-r--r-- | app/models/built_hearth_amenity.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/built_hearth_amenity.rb b/app/models/built_hearth_amenity.rb index c4d5a53..5ae8a42 100644 --- a/app/models/built_hearth_amenity.rb +++ b/app/models/built_hearth_amenity.rb @@ -1,4 +1,6 @@ class BuiltHearthAmenity < ApplicationRecord belongs_to :hearth belongs_to :hearth_amenity + + validates :hearth_id, uniqueness: { scope: :hearth_amenity_id } end |