Add comments to the code [SCI-152]

This commit is contained in:
Oleksii Kriuchykhin 2017-05-09 10:18:57 +02:00
parent 344b9c290a
commit 7a61f5813c
4 changed files with 6 additions and 4 deletions

View file

@ -77,8 +77,8 @@ class MyModuleCommentsController < ApplicationController
}
),
date: @comment.created_at.strftime('%d.%m.%Y'),
linked_id: @my_module.id,
counter: @my_module.task_comments.count
linked_id: @my_module.id, # Used for counter badge
counter: @my_module.task_comments.count # Used for counter badge
},
status: :created
end
@ -155,6 +155,7 @@ class MyModuleCommentsController < ApplicationController
module: @my_module.name
)
)
# 'counter' and 'linked_id' are used for counter badge
render json: { linked_id: @my_module.id,
counter: @my_module.task_comments.count },
status: :ok

View file

@ -146,6 +146,7 @@ class ProjectCommentsController < ApplicationController
project: @project.name
)
)
# 'counter' and 'linked_id' are used for counter badge
render json: { linked_id: @project.id,
counter: @project.project_comments.count },
status: :ok

View file

@ -15,7 +15,7 @@ class UserMyModulesController < ApplicationController
partial: 'index.html.erb'
),
my_module_id: @my_module.id,
counter: @my_module.users.count
counter: @my_module.users.count # Used for counter badge
}
end
end

View file

@ -19,7 +19,7 @@ class UserProjectsController < ApplicationController
partial: 'index.html.erb'
),
project_id: @project.id,
counter: @project.users.count
counter: @project.users.count # Used for counter badge
}
end
end