Skip to content

Instantly share code, notes, and snippets.

@talum
Last active November 25, 2018 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talum/7d45d401e93c058a21612a10890e5c9d to your computer and use it in GitHub Desktop.
Save talum/7d45d401e93c058a21612a10890e5c9d to your computer and use it in GitHub Desktop.
# some other caller
def set_projects_progress_status!
project_repo_ids = AssignedRepo.team_projects_for(batch_id: batch.id, track_id: track.id).pluck(:canonical_id)
end
def set_projects_progress_status!
project_repo_ids = AssignedRepo.team_projects_for(batch_id: batch.id, track_id: track.id).canonical_github_repository_ids
end
# Assigned Repo
# app/models/assigned_repo.rb
class AssignedRepo < ActiveRecord::Model
### Omitted
def self.canonical_github_repository_ids
if $rollout.active?(:remove_content)
joins(:canonical_material)
.pluck("course_work_canonical_materials.github_repository_id")
.uniq
else
pluck(:canonical_id)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment