Skip to content

Instantly share code, notes, and snippets.

View gregbell's full-sized avatar

Greg Bell gregbell

View GitHub Profile
# 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