Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
36cd24ae
Commit
36cd24ae
authored
May 22, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
bda912dc
90bb8a21
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
.gitlab/ci/qa.gitlab-ci.yml
.gitlab/ci/qa.gitlab-ci.yml
+1
-1
rubocop/cop/code_reuse/active_record.rb
rubocop/cop/code_reuse/active_record.rb
+2
-1
spec/rubocop/cop/code_reuse/active_record_spec.rb
spec/rubocop/cop/code_reuse/active_record_spec.rb
+3
-3
No files found.
.gitlab/ci/qa.gitlab-ci.yml
View file @
36cd24ae
package-and-qa
:
image
:
ruby:2.6-alpine
stage
:
qa
stage
:
review
# So even if review-deploy failed we can still run this
when
:
manual
before_script
:
[]
dependencies
:
[]
...
...
rubocop/cop/code_reuse/active_record.rb
View file @
36cd24ae
...
...
@@ -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
...
...
spec/rubocop/cop/code_reuse/active_record_spec.rb
View file @
36cd24ae
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment