Module: UserNotification::Deactivatable::ClassMethods

Defined in:
lib/user_notification/roles/deactivatable.rb

Overview

Provides global methods to disable or enable UserNotification on a per-class basis.

Instance Method Summary collapse

Instance Method Details

#set_user_notification_class_defaultsObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 1.0.0



36
37
38
39
# File 'lib/user_notification/roles/deactivatable.rb', line 36

def set_user_notification_class_defaults
  super
  self.user_notification_enabled_for_model = true
end

#user_notification_offObject

Switches user_notification off for this class



25
26
27
# File 'lib/user_notification/roles/deactivatable.rb', line 25

def user_notification_off
  self.user_notification_enabled_for_model = false
end

#user_notification_onObject

Switches user_notification on for this class



30
31
32
# File 'lib/user_notification/roles/deactivatable.rb', line 30

def user_notification_on
  self.user_notification_enabled_for_model = true
end