Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Event::CommentForProject
Event::Subscription -> Event::CommentForProject
-> User/Group
Event.all each do | event |
Event::CommentForProject > Event::Subscription > *User* > do something
end
[Event::CommentForProject Event::CommentForProject].each do |event|
NEW::Subscription > do something
end
class SendEventProjectJob
Event::CommentForProject.each do |event|
NEW::Subscription.where(project: event.payload['project']).each do |sub|
send mail to sub.user
end
end
end
class SendBuildFailJob
Event::CommentForProject.each do |event|
NEW::Subscription.find_project_by_name_amd_arch(project: event.payload['project'], arch: event.payload['arch').each do |sub|
send mail to sub.user
end
end
end
class NEW::Subscription
user: evan
events: CommentForProject, CommentForPackage, BuildFail
projects: home:evan, User.involved_projects, User.project_where_I_am_maintainer, User.packages_where_I_am_bugowner, User.watched_projects
def find_project_by_name_amd_arch
query for this shit
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment