Guest User

Untitled

a guest
Jan 23rd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def self.find_by_email(email)
  2. User.new :email => email
  3. if engine_user = EngineUser.find_by_email(email)
  4. return find_by_engine_user_id(engine_user.id)
  5. end
  6. end
  7.  
  8. def self.find_by_email!(email)
  9. engine_user = self.find_by_email(email)
  10. raise ActiveRecord::RecordNotFound unless engine_user
  11. engine_user
  12. end
Add Comment
Please, Sign In to add comment