             newIsDeprecated = $el.find("input[name='is-deprecated']").prop("checked")
 
             if newDescription != attachment.description
-                attachment.setAttr("description", newDescription)
+                attachment.description = newDescription
             if newIsDeprecated != attachment.is_deprecated
-                attachment.setAttr("is_deprecated", newIsDeprecated)
+                attachment.is_deprecated = newIsDeprecated
 
             onSuccess = ->
                 $ctrl.loadAttachments(attachment.object_id)

    <a class="editable icon icon-delete" href="" title="Cancel"></a>
    """) # TODO: i18n

    link = ($scope, $el, $attrs, $model) ->
        $ctrl = $el.controller()

        render = (attachment, isEditable=false) ->

                    _.sorBy($scope.attachments, 'order')

        ## Total attachments counter
        $scope.$watch "attachmentsCount", (count) ->
            $el.find("span.attachments-num").html(count)

        ## Show/Hide deprecated attachments
        $scope.showDeprecatedAttachments = false

        $scope.$watch "deprecatedAttachmentsCount", (deprecatedAttachmentsCount) ->
