Skip to content

Instantly share code, notes, and snippets.

@gregbell
Created September 25, 2008 22:55
Show Gist options
  • Save gregbell/12975 to your computer and use it in GitHub Desktop.
Save gregbell/12975 to your computer and use it in GitHub Desktop.
# Find all the proper employees
employees = Employee.find(:all, :conditions => 'conditions to get the right employees')
# Add the employee that we want (by email address)
# to the top of the list
# Then call uniq on it to remove the duplicate
employees.unshift(employees.find{ |employee| employee.email_address == "email we want at the top" }).uniq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment