Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Explicit search by username in email string #1

Merged
merged 1 commit into from

2 participants

@route

No description provided.

@divineforest divineforest merged commit a520143 into divineforest:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 17, 2012
  1. @route
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  app/controllers/dev_log_in_controller.rb
View
2  app/controllers/dev_log_in_controller.rb
@@ -2,7 +2,7 @@ class DevLogInController < ApplicationController
def log_in
if Rails.env.development? || Rails.env.test?
- user = User.where(["email LIKE ?", params[:login]+'%']).first || (raise "Can't find user '#{params[:login]}'")
+ user = User.where(User.arel_table[:email].matches("#{params[:login]}@%")).first!
sign_in_and_redirect(user)
else
raise "Works only in development or test env"
Something went wrong with that request. Please try again.