Commit a389d77769f941aac666df232f223692d0e95971
1 parent
c797493e
Exists in
spb-stable
and in
3 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,7 +198,7 @@ class User < ActiveRecord::Base | ||
198 | end | 198 | end |
199 | 199 | ||
200 | def by_username_or_id(name_or_id) | 200 | def by_username_or_id(name_or_id) |
201 | - where('users.username = ? OR users.id = ?', name_or_id, name_or_id.to_i).first | 201 | + where('users.username = ? OR users.id = ?', name_or_id.to_s, name_or_id.to_i).first |
202 | end | 202 | end |
203 | 203 | ||
204 | def build_user(attrs = {}, options= {}) | 204 | def build_user(attrs = {}, options= {}) |