diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 76d3d248b..43e5fe87a 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -451,6 +451,8 @@ class AccountController < ApplicationController def change_email user = User.find params[:user_id].to_i user.update_attributes(:mail => params[:value]) + token = Token.create(:user => user, :action => "register") + Mailer.run.register(token) result = {:email => user.mail, :email_link => user.mail.split("@")[1]} render :json => result diff --git a/app/controllers/challenges_controller.rb b/app/controllers/challenges_controller.rb index d3b236a01..af39f1931 100644 --- a/app/controllers/challenges_controller.rb +++ b/app/controllers/challenges_controller.rb @@ -91,9 +91,9 @@ class ChallengesController < ApplicationController respond_to do |format| if @challenge.update_attributes(params[:challenge]) ActiveRecord::Base.transaction do - @challenge_samples.destroy unless @challenge_samples.blank? - @test_sets.destroy unless @test_sets.blank? - @challenge_tags.destroy unless @challenge_tags.blank? + @challenge_samples.delete_all unless @challenge_samples.blank? + @test_sets.delete_all unless @test_sets.blank? + @challenge_tags.delete_all unless @challenge_tags.blank? if params[:sample][:input].length > 0 params[:sample][:input].each_with_index do |value, index| unless (value == params[:sample][:output][index] && value.blank?) diff --git a/app/models/user.rb b/app/models/user.rb index c5696385e..6be988e90 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -124,7 +124,7 @@ class User < Principal has_many :contestant_work_scores has_many :contestant_work_projects - has_many :shixuns, :through => :shixun_members, :dependent => :destroy + has_many :shixun_members, :dependent => :destroy has_many :challenges, :dependent => :destroy has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)}, diff --git a/app/views/games/_extend_file_edit_form.html.erb b/app/views/games/_extend_file_edit_form.html.erb index 6cfd101e3..5ad6c302d 100644 --- a/app/views/games/_extend_file_edit_form.html.erb +++ b/app/views/games/_extend_file_edit_form.html.erb @@ -4,17 +4,17 @@
  • -