Permalink
Browse files

Merge pull request #1 from route/patch-1

Explicit search by username in email string
  • Loading branch information...
2 parents 08fe6e8 + e16da35 commit a520143674ee01798372afa5fa5d3c982f998850 @divineforest committed Jul 24, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 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"

0 comments on commit a520143

Please sign in to comment.