Commit 0124ae18 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix User#by_username_or_id for postgres

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent ed82ab41
...@@ -198,7 +198,7 @@ class User < ActiveRecord::Base ...@@ -198,7 +198,7 @@ class User < ActiveRecord::Base
end end
def by_username_or_id(name_or_id) 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 end
def build_user(attrs = {}, options= {}) def build_user(attrs = {}, options= {})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment