Class: Setting

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/setting.rb

Class Method Summary collapse

Class Method Details

.check_user(user) ⇒ Object

check user update settings



6
7
8
9
10
11
12
13
14
# File 'app/models/setting.rb', line 6

def self.check_user(user)
  already_exist = UserNotificationSetting.where("user_id=?",user)
  if !already_exist.blank?
    user_exitence = "exist"
  else
    user_exitence = "not_exist"
  end
  return user_exitence
end

.notification_alert(user, organization) ⇒ Object

Notification setting alert



17
18
19
20
21
22
23
24
# File 'app/models/setting.rb', line 17

def self.notification_alert(user, organization)
  @notification = Notification.create(
    :summary => "Notification setting has been changed",
    :notification_type => "NSC",
    :notified_by => user,
  )
  @notification.add_notifiers([user])
end