Skip to content

Instantly share code, notes, and snippets.

@danmcclain
Created November 4, 2011 16:09
Show Gist options
  • Select an option

  • Save danmcclain/1339713 to your computer and use it in GitHub Desktop.

Select an option

Save danmcclain/1339713 to your computer and use it in GitHub Desktop.
note_ids = NotesStudent.where(student_id: current_user.student_ids).select(:note_id).map {|n| n.note_id }
user_id = current_user.id
@notes = Note.accessible_by(current_ability).where{ (id >> note_ids) | (counselor_id == user_id) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment