Skip to content

Instantly share code, notes, and snippets.

active_projects = Project
.where(org_id: org_id)
.where(enabled: true)
.where("active_until IS NULL OR active_until > ?", Time.current)
runnable_keywords = Keyword
.joins(keyword_group: :project)
.where(projects: { org_id: org_id, enabled: true })
.where("projects.active_until IS NULL OR projects.active_until > ?", Time.current)
.where(