Fix User#by_username_or_id for postgres
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
c797493e00
commit
a389d77769
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('users.username = ? OR users.id = ?', name_or_id, name_or_id.to_i).first
|
||||
where('users.username = ? OR users.id = ?', name_or_id.to_s, name_or_id.to_i).first
|
||||
end
|
||||
|
||||
def build_user(attrs = {}, options= {})
|
||||
|
|
Loading…
Reference in a new issue