diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e94448174..faadc5a46 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -18,12 +18,6 @@ Lint/IneffectiveAccessModifier: - 'app/black_box/black_box.rb' - 'app/models/tweet.rb' -# Offense count: 3 -Lint/ShadowingOuterLocalVariable: - Exclude: - - 'app/views/api/v0/comments/index.json.jbuilder' - - 'app/views/api/v0/comments/show.json.jbuilder' - # Offense count: 2 # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods. Lint/UselessAccessModifier: diff --git a/app/views/api/v0/comments/index.json.jbuilder b/app/views/api/v0/comments/index.json.jbuilder index 2ff47af62..f53ec613e 100644 --- a/app/views/api/v0/comments/index.json.jbuilder +++ b/app/views/api/v0/comments/index.json.jbuilder @@ -11,29 +11,29 @@ json.array! Comment.rooted_on(@commentable.id, @commentable_type).order("score D json.profile_image ProfileImage.new(comment.user).get(640) json.profile_image_90 ProfileImage.new(comment.user).get(90) end - json.children comment.children.order("score DESC").each do |comment| - json.id_code comment.id_code_generated - json.body_html comment.processed_html + json.children comment.children.order("score DESC").each do |children_comment| + json.id_code children_comment.id_code_generated + json.body_html children_comment.processed_html json.user do - json.name comment.user.name - json.username comment.user.username - json.twitter_username comment.user.twitter_username - json.github_username comment.user.github_username - json.website_url comment.user.processed_website_url - json.profile_image ProfileImage.new(comment.user).get(640) - json.profile_image_90 ProfileImage.new(comment.user).get(90) + json.name children_comment.user.name + json.username children_comment.user.username + json.twitter_username children_comment.user.twitter_username + json.github_username children_comment.user.github_username + json.website_url children_comment.user.processed_website_url + json.profile_image ProfileImage.new(children_comment.user).get(640) + json.profile_image_90 ProfileImage.new(children_comment.user).get(90) end - json.children comment.children.order("score DESC").each do |comment| - json.id_code comment.id_code_generated - json.body_html comment.processed_html + json.children children_comment.children.order("score DESC").each do |grandchild_comment| + json.id_code grandchild_comment.id_code_generated + json.body_html grandchild_comment.processed_html json.user do - json.name comment.user.name - json.username comment.user.username - json.twitter_username comment.user.twitter_username - json.github_username comment.user.github_username - json.website_url comment.user.processed_website_url - json.profile_image ProfileImage.new(comment.user).get(640) - json.profile_image_90 ProfileImage.new(comment.user).get(90) + json.name grandchild_comment.user.name + json.username grandchild_comment.user.username + json.twitter_username grandchild_comment.user.twitter_username + json.github_username grandchild_comment.user.github_username + json.website_url grandchild_comment.user.processed_website_url + json.profile_image ProfileImage.new(grandchild_comment.user).get(640) + json.profile_image_90 ProfileImage.new(grandchild_comment.user).get(90) end end end diff --git a/app/views/api/v0/comments/show.json.jbuilder b/app/views/api/v0/comments/show.json.jbuilder index 71e6acf9b..3c38a45a5 100644 --- a/app/views/api/v0/comments/show.json.jbuilder +++ b/app/views/api/v0/comments/show.json.jbuilder @@ -10,29 +10,29 @@ json.user do json.profile_image ProfileImage.new(@comment.user).get(640) json.profile_image_90 ProfileImage.new(@comment.user).get(90) end -json.children @comment.children.order("score DESC").each do |comment| - json.id_code comment.id_code_generated - json.body_html comment.processed_html +json.children @comment.children.order("score DESC").each do |children_comment| + json.id_code children_comment.id_code_generated + json.body_html children_comment.processed_html json.user do - json.name comment.user.name - json.username comment.user.username - json.twitter_username comment.user.twitter_username - json.github_username comment.user.github_username - json.website_url comment.user.processed_website_url - json.profile_image ProfileImage.new(comment.user).get(640) - json.profile_image_90 ProfileImage.new(comment.user).get(90) + json.name children_comment.user.name + json.username children_comment.user.username + json.twitter_username children_comment.user.twitter_username + json.github_username children_comment.user.github_username + json.website_url children_comment.user.processed_website_url + json.profile_image ProfileImage.new(children_comment.user).get(640) + json.profile_image_90 ProfileImage.new(children_comment.user).get(90) end - json.children comment.children.order("score DESC").each do |comment| - json.id_code comment.id_code_generated - json.body_html comment.processed_html + json.children children_comment.children.order("score DESC").each do |grandchild_comment| + json.id_code grandchild_comment.id_code_generated + json.body_html grandchild_comment.processed_html json.user do - json.name comment.user.name - json.username comment.user.username - json.twitter_username comment.user.twitter_username - json.github_username comment.user.github_username - json.website_url comment.user.processed_website_url - json.profile_image ProfileImage.new(comment.user).get(640) - json.profile_image_90 ProfileImage.new(comment.user).get(90) + json.name grandchild_comment.user.name + json.username grandchild_comment.user.username + json.twitter_username grandchild_comment.user.twitter_username + json.github_username grandchild_comment.user.github_username + json.website_url grandchild_comment.user.processed_website_url + json.profile_image ProfileImage.new(grandchild_comment.user).get(640) + json.profile_image_90 ProfileImage.new(grandchild_comment.user).get(90) end end end