Fix User#by_username_or_id for postgres
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
ed82ab4117
commit
0124ae18c5
1 changed files with 1 additions and 1 deletions
|
@ -198,7 +198,7 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def by_username_or_id(name_or_id)
|
||||
where('username = ? OR id = ?', name_or_id, name_or_id).first
|
||||
where('users.username = ? OR users.id = ?', name_or_id, name_or_id.to_i).first
|
||||
end
|
||||
|
||||
def build_user(attrs = {}, options= {})
|
||||
|
|
Loading…
Reference in a new issue