0
0
Fork 0

Refactor User and spec (#3431)

* Protect send_devise_notification of User

* Improve spec for User
This commit is contained in:
Akihiko Odaki 2017-05-30 22:28:56 +09:00 committed by Eugen Rochko
parent e031fd60ad
commit 7db98aa70e
2 changed files with 119 additions and 14 deletions

View file

@ -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