Commit 0124ae18c594fbc7c40bcf80e44a9feb0b9cf977
1 parent
ed82ab41
Exists in
master
and in
4 other branches
Fix User#by_username_or_id for postgres
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/user.rb
... | ... | @@ -198,7 +198,7 @@ class User < ActiveRecord::Base |
198 | 198 | end |
199 | 199 | |
200 | 200 | def by_username_or_id(name_or_id) |
201 | - where('username = ? OR id = ?', name_or_id, name_or_id).first | |
201 | + where('users.username = ? OR users.id = ?', name_or_id, name_or_id.to_i).first | |
202 | 202 | end |
203 | 203 | |
204 | 204 | def build_user(attrs = {}, options= {}) | ... | ... |