Skip to content

Instantly share code, notes, and snippets.

@caseywatts
Created March 11, 2013 22:11
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 caseywatts/5138333 to your computer and use it in GitHub Desktop.
Save caseywatts/5138333 to your computer and use it in GitHub Desktop.
Get emails of users who have worked in a location over a time period (Shifts app)
user_emails = []
Shift.after_date(Time.now - 4.weeks).find_all_by_location_id(44).each do |sh|
user_emails << sh.user.email
end
user_emails = user_emails.uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment