Guest User

Untitled

a guest
Feb 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. # Find all the proper employees
  2. employees = Employee.find(:all, :conditions => 'conditions to get the right employees')
  3.  
  4. # Add the employee that we want (by email address)
  5. # to the top of the list
  6. # Then call uniq on it to remove the duplicate
  7. employees.unshift(employees.find{ |employee| employee.email_address == "email we want at the top" }).uniq
Add Comment
Please, Sign In to add comment