app/models/notification.rb
# returns the path that the user is sent to when the notification is clicked:
# profile path for notifications about new courses or lectures
# lecture path for announcements in lectures
# news path for general announcements
# all other cases: notifiable path
returns the path that the user is sent to when the notification is clicked:
profile path for notifications about new courses or lectures
lecture path for announcements in lectures
news path for general announcements
all other cases: notifiable path
returns the path that the user is sent to when the notification is clicked : profile path for notifications about new courses or lectures lecture path for announcements in lectures news path for general announcements all other cases : notifiable path
def path(user)
    return unless notifiable.present?
    return edit_profile_path if notifiable_type.in?(['Course', 'Lecture'])
    if notifiable_type == 'Announcement'
      return notifiable.lecture.path(user) if notifiable.lecture.present?
      return news_path
    end
    if notifiable_type == 'Medium' && notifiable.sort == 'Quiz'
      return medium_path(notifiable)
    end
    polymorphic_url(notifiable, only_path: true)
  end
def path ( user ) return unless notifiable . present? return edit_profile_path if notifiable_type . in? ( [ 'Course' , 'Lecture' ] ) if notifiable_type == 'Announcement' return notifiable . lecture . path ( user ) if notifiable . lecture . present? return news_path end if notifiable_type == 'Medium' && notifiable . sort == 'Quiz' return medium_path ( notifiable ) end polymorphic_url ( notifiable , only_path : true ) end
returns the path that the user is sent to when the notification is clicked:
profile path for notifications about new courses or lectures
lecture path for announcements in lectures
news path for general announcements
all other cases: notifiable path
returns the path that the user is sent to when the notification is clicked : profile path for notifications about new courses or lectures lecture path for announcements in lectures news path for general announcements all other cases : notifiable path
user
<not_specific>