diff options
author | David Gay <david@davidgay.org> | 2021-05-25 20:44:53 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-25 20:48:00 -0400 |
commit | 3f079ef8a7d46d5a4864836dbbd9e37b900c0a59 (patch) | |
tree | 612089e06320cdbba5bdd5ff99b10826a1ee4519 /app/models | |
parent | 7c191c15e3a16c5c4c53f6d83c89fe6d1219b6e5 (diff) |
Award title for mining a yellow beryl
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/character.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/character.rb b/app/models/character.rb index 970ede1..92e84c7 100644 --- a/app/models/character.rb +++ b/app/models/character.rb @@ -150,6 +150,13 @@ class Character < ApplicationRecord self.update(activity: nil, activity_started_at: nil, queued_actions: nil) end + def award_title(title) + title = Title.find_by_gid(title) if title.is_a? String + # TODO: Simplify these lines? + return false if self.title_awards.exists?(title: title) + self.title_awards.create(title: title) + end + def equipment_stats stats = {} self.equipment.each do |eq| |