diff --git a/app/models/user.rb b/app/models/user.rb index c1dbc8c83..23b2f1cb2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -25,10 +25,6 @@ class User < ApplicationRecord update! active: false, email_address: deactived_email_address end - def to_attachable_partial_path - "users/attachable" - end - private def deactived_email_address email_address.sub(/@/, "-deactivated-#{SecureRandom.uuid}@") diff --git a/app/models/user/mentionable.rb b/app/models/user/mentionable.rb index 7a930ab02..be82f3d95 100644 --- a/app/models/user/mentionable.rb +++ b/app/models/user/mentionable.rb @@ -3,6 +3,11 @@ module User::Mentionable included do has_many :mentions, dependent: :destroy, inverse_of: :mentionee + + # Need to set in the included block so that it overrides Action Text's + def to_attachable_partial_path + "users/attachable" + end end def mentioned_by(mentioner, at:) @@ -13,6 +18,10 @@ module User::Mentionable [ initials, first_name, first_name_with_last_name_initial ].collect(&:downcase) end + def content_type + "application/vnd.actiontext.mention" + end + private def first_name_with_last_name_initial "#{first_name}#{last_name&.first}" diff --git a/app/views/cards/comments/_new.html.erb b/app/views/cards/comments/_new.html.erb index 68659dd38..8237fda1e 100644 --- a/app/views/cards/comments/_new.html.erb +++ b/app/views/cards/comments/_new.html.erb @@ -7,10 +7,13 @@