summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-07-11 15:55:19 -0400
committerDavid Gay <david@davidgay.org>2021-07-11 15:55:19 -0400
commit362b92dbebf1ccc529794890153f8c1bfc43637d (patch)
tree532f6901b2e8dfd335262d2ae81ca248af402539 /app
parent1d0f65a3c143c729aea0a22fe4666a8a0cff23c9 (diff)
Give hearths a location
Diffstat (limited to 'app')
-rw-r--r--app/models/hearth.rb1
-rw-r--r--app/models/location.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/app/models/hearth.rb b/app/models/hearth.rb
index ee00c0c..cbd98dc 100644
--- a/app/models/hearth.rb
+++ b/app/models/hearth.rb
@@ -1,5 +1,6 @@
class Hearth < ApplicationRecord
belongs_to :character
+ belongs_to :location
has_many :built_hearth_amenities
has_many :hearth_amenities, through: :built_hearth_amenities
has_many :hearth_plantings
diff --git a/app/models/location.rb b/app/models/location.rb
index 7bd1386..e0aaf9b 100644
--- a/app/models/location.rb
+++ b/app/models/location.rb
@@ -3,6 +3,7 @@ class Location < ApplicationRecord
has_many :activities
has_many :characters
+ has_many :hearths
has_many :monster_spawns
validates :gid, :name, presence: true
end