summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorDavid Gay <david@davidgay.org>2021-07-05 20:30:15 -0400
committerDavid Gay <david@davidgay.org>2021-07-05 20:30:15 -0400
commit28426519e11e72576b1a3339f47c420f9c184e49 (patch)
treeae92cce4888f8cbd038359902a6db6df557fe5cc /app/models
parentf160f81a6daae8b478a5547078abc7c7b29ef747 (diff)
Give characters a location, and replace the Locations view+controller with a Look view+controller
Diffstat (limited to 'app/models')
-rw-r--r--app/models/character.rb1
-rw-r--r--app/models/location.rb1
2 files changed, 2 insertions, 0 deletions
diff --git a/app/models/character.rb b/app/models/character.rb
index 2669626..96dafd0 100644
--- a/app/models/character.rb
+++ b/app/models/character.rb
@@ -1,6 +1,7 @@
class Character < ApplicationRecord
belongs_to :user
belongs_to :activity, optional: true
+ belongs_to :location
has_many :title_awards
has_many :titles, through: :title_awards
belongs_to :active_title, class_name: "Title", optional: true
diff --git a/app/models/location.rb b/app/models/location.rb
index e008270..7bd1386 100644
--- a/app/models/location.rb
+++ b/app/models/location.rb
@@ -2,6 +2,7 @@ class Location < ApplicationRecord
include HasWhatnot
has_many :activities
+ has_many :characters
has_many :monster_spawns
validates :gid, :name, presence: true
end