summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-05-20 18:25:35 -0400
committerDavid Gay <david@davidgay.org>2021-05-20 18:25:35 -0400
commitc25a079be25cc0aadf85119d97d8e1b9395b15fb (patch)
tree3c27d8b75323ae6f48be2a34d5f022a4c8b8b388 /app
parent71f15b6534ffa7ba159d5e4076d59bb7961089a9 (diff)
Add uniqueness scope constraint to BuiltHearthAmenity
Diffstat (limited to 'app')
-rw-r--r--app/models/built_hearth_amenity.rb2
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