人物注册地址信息会保存两次的问题。
This commit is contained in:
parent
cc39172d87
commit
2000f1ddf6
|
@ -144,14 +144,16 @@ class AccountController < ApplicationController
|
||||||
|
|
||||||
#added by bai
|
#added by bai
|
||||||
unless @user.id.nil?
|
unless @user.id.nil?
|
||||||
ue = UserExtensions.create(:identity => params[:identity].to_i,:technical_title => params[:technical_title], :gender => params[:gender].to_i, :user_id => @user.id, :student_id => params[:no])
|
ue = @user.extensions
|
||||||
unless params[:province].nil? || params[:city].nil?
|
|
||||||
ue.location = params[:province]
|
ue.identity = params[:identity]
|
||||||
ue.location_city = params[:city]
|
ue.technical_title = params[:technical_title]
|
||||||
ue.save
|
ue.gender = params[:gender]
|
||||||
end
|
ue.student_id = params[:no]
|
||||||
|
ue.location = params[:province]
|
||||||
|
ue.location_city = params[:city]
|
||||||
|
@user.save
|
||||||
end
|
end
|
||||||
#end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -61,7 +61,7 @@ class MyController < ApplicationController
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@se = @user.user_extensions ||= UserExtensions.new
|
@se = @user.extensions
|
||||||
@se.school_id = params[:occupation] if params[:occupation]
|
@se.school_id = params[:occupation] if params[:occupation]
|
||||||
@se.gender = params[:gender]
|
@se.gender = params[:gender]
|
||||||
@se.location = params[:province] if params[:province]
|
@se.location = params[:province] if params[:province]
|
||||||
|
|
Loading…
Reference in New Issue