Last active
January 9, 2020 15:55
-
-
Save Keqi/7790ddb0ddfc43cfc414687c4691abcf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProjectsController < ApplicationController | |
# student.project is the reference to associated AR Project model. | |
def users_projects | |
teams = Team.all | |
students = teams.map(&:students).flatten | |
@student_projects = students.select do |student| | |
student.project.status == "Active" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment