From 7db98aa70e44c922bd13d72e78e0ae94826ad29f Mon Sep 17 00:00:00 2001 From: Akihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp> Date: Tue, 30 May 2017 22:28:56 +0900 Subject: Refactor User and spec (#3431) * Protect send_devise_notification of User * Improve spec for User --- app/models/user.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/models/user.rb b/app/models/user.rb index f367d74aa..8840de82d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -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 -- cgit