class NotificationSetting

Schema Information

Table name: notification_settings

id                :integer          not null, primary key
user_id           :integer
notification_type :integer
enabled           :boolean
university_id        :integer
created_at        :datetime
updated_at        :datetime

Constants

TYPES

Returns array containing notification type.

Public Instance Methods

notification_type_text() click to toggle source

Returns notification type text nbase n notification type.

# File app/models/notification_setting.rb, line 27
def notification_type_text
  if notification_type
    case TYPES[notification_type]
      when 'transaction'
        'Transfer Funds - Pay'
      when 'invoice'
        'Transfer Funds - Invoice'
      when 'tutoringsession'
        'Tutoring Session'
      when 'question'
        'Question'
      when 'answer'
        'Answer'
      when 'friendship'
        'Friend'
      when 'schedule'
        'Event'
      else
        TYPES[notification_type]
    end
  end
end