Coursemology/coursemology2

View on GitHub
app/controllers/concerns/course/activity_feeds_concern.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true
module Course::ActivityFeedsConcern
  extend ActiveSupport::Concern

  # Loads recent activity feeds of a given course.
  #
  # @return [Array<Course::Notification>] Recent activity feed notifications
  def recent_activity_feeds
    return [] if current_course.nil?

    current_course.notifications.feed.order(created_at: :desc)
  end
end