summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2019-05-22 15:24:42 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2019-05-22 15:24:42 +0000
commitbfa847d69a4ede85c51a07c24a730096e135dd43 (patch)
tree9af6348560937f3f63026aba612a592b9ae9fa8a
parent47bfa0a00a4d345274234bfa5391ac0ecd7d9754 (diff)
parent3783c23457adaa4a1f97ffd0891a1a5a8d02f188 (diff)
downloadgitlab-ce-bfa847d69a4ede85c51a07c24a730096e135dd43.tar.gz
Merge branch 'link-to-issue-in-code-reuse-active-record-rubocop-rule' into 'master'
Link to issue in CodeReuse/ActiveRecord message See merge request gitlab-org/gitlab-ce!28461
-rw-r--r--rubocop/cop/code_reuse/active_record.rb3
-rw-r--r--spec/rubocop/cop/code_reuse/active_record_spec.rb6
2 files changed, 5 insertions, 4 deletions
diff --git a/rubocop/cop/code_reuse/active_record.rb b/rubocop/cop/code_reuse/active_record.rb
index 2be8f7c11aa..1e650abfceb 100644
--- a/rubocop/cop/code_reuse/active_record.rb
+++ b/rubocop/cop/code_reuse/active_record.rb
@@ -9,7 +9,8 @@ module RuboCop
class ActiveRecord < RuboCop::Cop::Cop
include CodeReuseHelpers
- MSG = 'This method can only be used inside an ActiveRecord model'
+ MSG = 'This method can only be used inside an ActiveRecord model: ' \
+ 'https://gitlab.com/gitlab-org/gitlab-ce/issues/49653'
# Various methods from ActiveRecord::Querying that are blacklisted. We
# exclude some generic ones such as `any?` and `first`, as these may
diff --git a/spec/rubocop/cop/code_reuse/active_record_spec.rb b/spec/rubocop/cop/code_reuse/active_record_spec.rb
index a30fc52d26f..8f3a3690d88 100644
--- a/spec/rubocop/cop/code_reuse/active_record_spec.rb
+++ b/spec/rubocop/cop/code_reuse/active_record_spec.rb
@@ -14,7 +14,7 @@ describe RuboCop::Cop::CodeReuse::ActiveRecord do
expect_offense(<<~SOURCE)
def foo
User.where
- ^^^^^ This method can only be used inside an ActiveRecord model
+ ^^^^^ This method can only be used inside an ActiveRecord model: https://gitlab.com/gitlab-org/gitlab-ce/issues/49653
end
SOURCE
end
@@ -23,7 +23,7 @@ describe RuboCop::Cop::CodeReuse::ActiveRecord do
expect_offense(<<~SOURCE)
def foo
User.where(id: 10)
- ^^^^^ This method can only be used inside an ActiveRecord model
+ ^^^^^ This method can only be used inside an ActiveRecord model: https://gitlab.com/gitlab-org/gitlab-ce/issues/49653
end
SOURCE
end
@@ -40,7 +40,7 @@ describe RuboCop::Cop::CodeReuse::ActiveRecord do
expect_offense(<<~SOURCE)
def foo
project.group(:name)
- ^^^^^ This method can only be used inside an ActiveRecord model
+ ^^^^^ This method can only be used inside an ActiveRecord model: https://gitlab.com/gitlab-org/gitlab-ce/issues/49653
end
SOURCE
end