Unescape user's summary (#360)
* Unescape user's summary * Add guard clause to User#unescape_summary
This commit is contained in:
parent
ad2e908947
commit
6d3c2e050f
1 changed files with 6 additions and 0 deletions
|
|
@ -82,6 +82,7 @@ class User < ApplicationRecord
|
|||
before_validation :set_username
|
||||
before_validation :downcase_email
|
||||
before_validation :check_for_username_change
|
||||
before_validation :unescape_summary
|
||||
|
||||
algoliasearch per_environment: true, enqueue: :trigger_delayed_index do
|
||||
attribute :name
|
||||
|
|
@ -274,6 +275,11 @@ class User < ApplicationRecord
|
|||
|
||||
private
|
||||
|
||||
def unescape_summary
|
||||
return unless summary.present?
|
||||
self.summary = CGI.unescapeHTML(summary)
|
||||
end
|
||||
|
||||
def send_welcome_notification
|
||||
Broadcast.send_welcome_notification(id)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue