修改一个查询user的bug

This commit is contained in:
lizanle 2015-05-15 10:17:47 +08:00
parent d2bf8a16de
commit 75643b8181
1 changed files with 3 additions and 3 deletions

View File

@ -9,7 +9,7 @@ module Mobile
u[f]
elsif u.is_a?(::User)
if u.respond_to?(f)
u.send(f)
u.send(f) unless u.user_extensions.nil?
else
case f
when :img_url
@ -17,9 +17,9 @@ module Mobile
when :gender
u.nil? || u.user_extensions.nil? || u.user_extensions.gender.nil? ? 0 : u.user_extensions.gender
when :work_unit
get_user_work_unit u
get_user_work_unit u unless u.user_extensions.nil?
when :location
get_user_location u
get_user_location u unless u.user_extensions.nil?
when :brief_introduction
u.nil? || u.user_extensions.nil? ? "" : u.user_extensions.brief_introduction
end