diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-30 11:56:07 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2018-08-30 11:56:07 +0300 |
commit | f474f16faed3cbf1c5c113bfe4227109b76ffb3e (patch) | |
tree | 0641af666fe5bc17a9ed55a9ddabc46a9647dd61 /lib | |
parent | f4d04ee9aaaead634543ee024d275f20edbe563e (diff) | |
parent | 4a37cd0dc08ccef417a423b3a9a91b33c26c4199 (diff) |
Merge branch '50414-rubocop-rule-to-enforce-class-methods-over-module' into 'master'
Resolve "Make a Rubocop cop to prefer class_methods over ClassMethods for ActiveSupport::Concern"
Closes #50414
See merge request gitlab-org/gitlab-ce!21379
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/api_guard.rb | 2 | ||||
-rw-r--r-- | lib/api/projects_relation_builder.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/github_import/representation/expose_attribute.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/graphql/mount_mutation.rb | 2 | ||||
-rw-r--r-- | lib/static_model.rb | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/api/api_guard.rb b/lib/api/api_guard.rb index c17089759de..8ee7987cfff 100644 --- a/lib/api/api_guard.rb +++ b/lib/api/api_guard.rb @@ -84,7 +84,7 @@ module API end end - module ClassMethods + class_methods do private def install_error_responders(base) diff --git a/lib/api/projects_relation_builder.rb b/lib/api/projects_relation_builder.rb index 6482fd94ab8..9fd79c491c2 100644 --- a/lib/api/projects_relation_builder.rb +++ b/lib/api/projects_relation_builder.rb @@ -2,7 +2,7 @@ module API module ProjectsRelationBuilder extend ActiveSupport::Concern - module ClassMethods + class_methods do def prepare_relation(projects_relation, options = {}) projects_relation = preload_relation(projects_relation, options) execute_batch_counting(projects_relation) diff --git a/lib/gitlab/github_import/representation/expose_attribute.rb b/lib/gitlab/github_import/representation/expose_attribute.rb index c3405759631..d2438ee8094 100644 --- a/lib/gitlab/github_import/representation/expose_attribute.rb +++ b/lib/gitlab/github_import/representation/expose_attribute.rb @@ -6,7 +6,7 @@ module Gitlab module ExposeAttribute extend ActiveSupport::Concern - module ClassMethods + class_methods do # Defines getter methods for the given attribute names. # # Example: diff --git a/lib/gitlab/graphql/mount_mutation.rb b/lib/gitlab/graphql/mount_mutation.rb index 8cab84d7a5f..9048967d4e1 100644 --- a/lib/gitlab/graphql/mount_mutation.rb +++ b/lib/gitlab/graphql/mount_mutation.rb @@ -5,7 +5,7 @@ module Gitlab module MountMutation extend ActiveSupport::Concern - module ClassMethods + class_methods do def mount_mutation(mutation_class) # Using an underscored field name symbol will make `graphql-ruby` # standardize the field name diff --git a/lib/static_model.rb b/lib/static_model.rb index 60e2dd82e4e..44673c2b5f6 100644 --- a/lib/static_model.rb +++ b/lib/static_model.rb @@ -2,7 +2,7 @@ module StaticModel extend ActiveSupport::Concern - module ClassMethods + class_methods do # Used by ActiveRecord's polymorphic association to set object_id def primary_key 'id' |