Skip to content

Instantly share code, notes, and snippets.

@temochka
Created September 2, 2011 04:47
Show Gist options
  • Save temochka/1187931 to your computer and use it in GitHub Desktop.
Save temochka/1187931 to your computer and use it in GitHub Desktop.
def self.find_by_email(email)
User.new :email => email
if engine_user = EngineUser.find_by_email(email)
return find_by_engine_user_id(engine_user.id)
end
end
def self.find_by_email!(email)
engine_user = self.find_by_email(email)
raise ActiveRecord::RecordNotFound unless engine_user
engine_user
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment