app/controllers/enrollment_controller.rb
# resets all the contract's enrollments to the base contract credits.
resets all the contract's enrollments to the base contract credits.
resets all the contract ' s enrollments to the base contract credits .
def reset
    redir_error(TinyException::SECURITYHACK, @user) and return unless @contract && @privs[:edit]
    @enrollments = @contract.enrollments.all
    count = 0
    @enrollments.each do |e|
      next unless e.enrollment_status < Enrollment::STATUS_CLOSED
      count += 1
      e.inherit_credits
    end
    flash[:notice] = "Active enrollments have been reset to the base credits."
    redirect_to enrollments_path @contract
  end
def reset redir_error ( TinyException :: SECURITYHACK , @user ) and return unless @contract && @privs [ :edit ] @enrollments = @contract . enrollments . all count = 0 @enrollments . each do | e | next unless e . enrollment_status < Enrollment :: STATUS_CLOSED count += 1 e . inherit_credits end flash [ :notice ] = "Active enrollments have been reset to the base credits." redirect_to enrollments_path @contract end
resets all the contract's enrollments to the base contract credits.
resets all the contract ' s enrollments to the base contract credits .