 
     loadHistory: =>
         return @rs.issues.history(@scope.issueId).then (history) =>
-            _.each history, (historyResult) ->
-                #If description was modified take only the description_html field
+            for historyResult in history
+                # If description was modified take only the description_html field
                 if historyResult.values_diff.description?
                     historyResult.values_diff.description = historyResult.values_diff.description_diff
 

            @scope.issueId = data.issue
            return data

        promise.then null, =>
            @location.path("/not-found")
            @location.replace()

        return promise.then(=> @.loadProject())
                      .then(=> @.loadUsersAndRoles())
                      .then(=> @.loadIssue())
                      .then(=> @.loadAttachments(@scope.issueId))
                      .then(=> @.loadHistory())

    block: ->
        @rootscope.$broadcast("block", @scope.issue)


        promise = @.loadInitialData()

        # On Success
        promise.then =>
            @appTitle.set(@scope.issue.subject + " - " + @scope.project.name)

        # On Error
        promise.then null, (xhr) =>
            if xhr and xhr.status == 404
                @location.path("/not-found")
                @location.replace()
            return @q.reject(xhr)

        @scope.$on("attachment:create", => @.loadHistory())
        @scope.$on("attachment:edit", => @.loadHistory())
        @scope.$on("attachment:delete", => @.loadHistory())

    loadProject: ->
        return @rs.projects.get(@scope.projectId).then (project) =>
