Refactor User and spec (#3431)
* Protect send_devise_notification of User * Improve spec for User
This commit is contained in:
parent
e031fd60ad
commit
7db98aa70e
2 changed files with 119 additions and 14 deletions
|
@ -68,10 +68,6 @@ class User < ApplicationRecord
|
|||
save!
|
||||
end
|
||||
|
||||
def send_devise_notification(notification, *args)
|
||||
devise_mailer.send(notification, self, *args).deliver_later
|
||||
end
|
||||
|
||||
def setting_default_privacy
|
||||
settings.default_privacy || (account.locked? ? 'private' : 'public')
|
||||
end
|
||||
|
@ -88,6 +84,12 @@ class User < ApplicationRecord
|
|||
settings.auto_play_gif
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def send_devise_notification(notification, *args)
|
||||
devise_mailer.send(notification, self, *args).deliver_later
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def sanitize_languages
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue