Skip to content

Instantly share code, notes, and snippets.

@Timrael
Created February 29, 2012 08:17
Show Gist options
  • Save Timrael/1939102 to your computer and use it in GitHub Desktop.
Save Timrael/1939102 to your computer and use it in GitHub Desktop.
Redmine WTF
notified << author if author && author.active? && author.notify_about?(self)
if assigned_to
if assigned_to.is_a?(Group)
notified += assigned_to.users.select {|u| u.active? && u.notify_about?(self)}
else
notified << assigned_to if assigned_to.active? && assigned_to.notify_about?(self)
end
end
#-----------------
#Why not this way?
notified << author if author
if assigned_to
notified += if assigned_to.is_a?(Group)
assigned_to.users
else
[assigned_to]
end
end
notified.select! {|u| u.active? && u.notify_about?(self)}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment