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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
c6bddeac
Commit
c6bddeac
authored
Aug 27, 2018
by
Jacopo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updates code using class_methods over module ClassMethods
parent
8af40870
Changes
25
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
25 additions
and
25 deletions
+25
-25
app/models/concerns/atomic_internal_id.rb
app/models/concerns/atomic_internal_id.rb
+1
-1
app/models/concerns/awardable.rb
app/models/concerns/awardable.rb
+1
-1
app/models/concerns/case_sensitivity.rb
app/models/concerns/case_sensitivity.rb
+1
-1
app/models/concerns/each_batch.rb
app/models/concerns/each_batch.rb
+1
-1
app/models/concerns/ignorable_column.rb
app/models/concerns/ignorable_column.rb
+1
-1
app/models/concerns/issuable.rb
app/models/concerns/issuable.rb
+1
-1
app/models/concerns/loaded_in_group_list.rb
app/models/concerns/loaded_in_group_list.rb
+1
-1
app/models/concerns/manual_inverse_association.rb
app/models/concerns/manual_inverse_association.rb
+1
-1
app/models/concerns/mentionable.rb
app/models/concerns/mentionable.rb
+1
-1
app/models/concerns/optionally_search.rb
app/models/concerns/optionally_search.rb
+1
-1
app/models/concerns/participable.rb
app/models/concerns/participable.rb
+1
-1
app/models/concerns/referable.rb
app/models/concerns/referable.rb
+1
-1
app/models/concerns/resolvable_note.rb
app/models/concerns/resolvable_note.rb
+1
-1
app/models/concerns/select_for_project_authorization.rb
app/models/concerns/select_for_project_authorization.rb
+1
-1
app/models/concerns/sha_attribute.rb
app/models/concerns/sha_attribute.rb
+1
-1
app/models/concerns/sortable.rb
app/models/concerns/sortable.rb
+1
-1
app/models/concerns/spammable.rb
app/models/concerns/spammable.rb
+1
-1
app/models/concerns/strip_attribute.rb
app/models/concerns/strip_attribute.rb
+1
-1
app/workers/concerns/application_worker.rb
app/workers/concerns/application_worker.rb
+1
-1
app/workers/concerns/waitable_worker.rb
app/workers/concerns/waitable_worker.rb
+1
-1
lib/api/api_guard.rb
lib/api/api_guard.rb
+1
-1
lib/api/projects_relation_builder.rb
lib/api/projects_relation_builder.rb
+1
-1
lib/gitlab/github_import/representation/expose_attribute.rb
lib/gitlab/github_import/representation/expose_attribute.rb
+1
-1
lib/gitlab/graphql/mount_mutation.rb
lib/gitlab/graphql/mount_mutation.rb
+1
-1
lib/static_model.rb
lib/static_model.rb
+1
-1
No files found.
app/models/concerns/atomic_internal_id.rb
View file @
c6bddeac
...
...
@@ -26,7 +26,7 @@
module
AtomicInternalId
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
def
has_internal_id
(
column
,
scope
:,
init
:,
presence:
true
)
# rubocop:disable Naming/PredicateName
# We require init here to retain the ability to recalculate in the absence of a
# InternaLId record (we may delete records in `internal_ids` for example).
...
...
app/models/concerns/awardable.rb
View file @
c6bddeac
...
...
@@ -12,7 +12,7 @@ module Awardable
end
end
module
ClassMethods
class_methods
do
def
awarded
(
user
,
name
)
sql
=
<<~
EOL
EXISTS (
...
...
app/models/concerns/case_sensitivity.rb
View file @
c6bddeac
...
...
@@ -4,7 +4,7 @@
module
CaseSensitivity
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
# Queries the given columns regardless of the casing used.
#
# Unlike other ActiveRecord methods this method only operates on a Hash.
...
...
app/models/concerns/each_batch.rb
View file @
c6bddeac
...
...
@@ -3,7 +3,7 @@
module
EachBatch
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
# Iterates over the rows in a relation in batches, similar to Rails'
# `in_batches` but in a more efficient way.
#
...
...
app/models/concerns/ignorable_column.rb
View file @
c6bddeac
...
...
@@ -14,7 +14,7 @@
module
IgnorableColumn
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
def
columns
super
.
reject
{
|
column
|
ignored_columns
.
include?
(
column
.
name
)
}
end
...
...
app/models/concerns/issuable.rb
View file @
c6bddeac
...
...
@@ -118,7 +118,7 @@ module Issuable
end
end
module
ClassMethods
class_methods
do
# Searches for records with a matching title.
#
# This method uses ILIKE on PostgreSQL and LIKE on MySQL.
...
...
app/models/concerns/loaded_in_group_list.rb
View file @
c6bddeac
...
...
@@ -3,7 +3,7 @@
module
LoadedInGroupList
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
def
with_counts
(
archived
:)
selects_including_counts
=
[
'namespaces.*'
,
...
...
app/models/concerns/manual_inverse_association.rb
View file @
c6bddeac
...
...
@@ -3,7 +3,7 @@
module
ManualInverseAssociation
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
def
manual_inverse_association
(
association
,
inverse
)
define_method
(
association
)
do
|*
args
|
super
(
*
args
).
tap
do
|
value
|
...
...
app/models/concerns/mentionable.rb
View file @
c6bddeac
...
...
@@ -10,7 +10,7 @@
module
Mentionable
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
# Indicate which attributes of the Mentionable to search for GFM references.
def
attr_mentionable
(
attr
,
options
=
{})
attr
=
attr
.
to_s
...
...
app/models/concerns/optionally_search.rb
View file @
c6bddeac
...
...
@@ -3,7 +3,7 @@
module
OptionallySearch
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
def
search
(
*
)
raise
(
NotImplementedError
,
...
...
app/models/concerns/participable.rb
View file @
c6bddeac
...
...
@@ -26,7 +26,7 @@
module
Participable
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
# Adds a list of participant attributes. Attributes can either be symbols or
# Procs.
#
...
...
app/models/concerns/referable.rb
View file @
c6bddeac
...
...
@@ -40,7 +40,7 @@ module Referable
end
end
module
ClassMethods
class_methods
do
# The character that prefixes the actual reference identifier
#
# This should be overridden by the including class.
...
...
app/models/concerns/resolvable_note.rb
View file @
c6bddeac
...
...
@@ -20,7 +20,7 @@ module ResolvableNote
scope
:unresolved
,
->
{
resolvable
.
where
(
resolved_at:
nil
)
}
end
module
ClassMethods
class_methods
do
# This method must be kept in sync with `#resolve!`
def
resolve!
(
current_user
)
unresolved
.
update_all
(
resolved_at:
Time
.
now
,
resolved_by_id:
current_user
.
id
)
...
...
app/models/concerns/select_for_project_authorization.rb
View file @
c6bddeac
...
...
@@ -3,7 +3,7 @@
module
SelectForProjectAuthorization
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
def
select_for_project_authorization
select
(
"projects.id AS project_id, members.access_level"
)
end
...
...
app/models/concerns/sha_attribute.rb
View file @
c6bddeac
...
...
@@ -3,7 +3,7 @@
module
ShaAttribute
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
def
sha_attribute
(
name
)
return
if
ENV
[
'STATIC_VERIFICATION'
]
...
...
app/models/concerns/sortable.rb
View file @
c6bddeac
...
...
@@ -19,7 +19,7 @@ module Sortable
scope
:order_name_desc
,
->
{
reorder
(
Arel
::
Nodes
::
Descending
.
new
(
arel_table
[
:name
].
lower
))
}
end
module
ClassMethods
class_methods
do
def
order_by
(
method
)
case
method
.
to_s
when
'created_asc'
then
order_created_asc
...
...
app/models/concerns/spammable.rb
View file @
c6bddeac
...
...
@@ -3,7 +3,7 @@
module
Spammable
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
def
attr_spammable
(
attr
,
options
=
{})
spammable_attrs
<<
[
attr
.
to_s
,
options
]
end
...
...
app/models/concerns/strip_attribute.rb
View file @
c6bddeac
...
...
@@ -14,7 +14,7 @@
module
StripAttribute
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
def
strip_attributes
(
*
attrs
)
strip_attrs
.
concat
(
attrs
)
end
...
...
app/workers/concerns/application_worker.rb
View file @
c6bddeac
...
...
@@ -11,7 +11,7 @@ module ApplicationWorker
set_queue
end
module
ClassMethods
class_methods
do
def
inherited
(
subclass
)
subclass
.
set_queue
end
...
...
app/workers/concerns/waitable_worker.rb
View file @
c6bddeac
...
...
@@ -3,7 +3,7 @@
module
WaitableWorker
extend
ActiveSupport
::
Concern
module
ClassMethods
class_methods
do
# Schedules multiple jobs and waits for them to be completed.
def
bulk_perform_and_wait
(
args_list
,
timeout:
10
)
# Short-circuit: it's more efficient to do small numbers of jobs inline
...
...
lib/api/api_guard.rb
View file @
c6bddeac
...
...
@@ -84,7 +84,7 @@ module API
end
end
module
ClassMethods
class_methods
do
private
def
install_error_responders
(
base
)
...
...
lib/api/projects_relation_builder.rb
View file @
c6bddeac
...
...
@@ -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
)
...
...
lib/gitlab/github_import/representation/expose_attribute.rb
View file @
c6bddeac
...
...
@@ -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:
...
...
lib/gitlab/graphql/mount_mutation.rb
View file @
c6bddeac
...
...
@@ -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
...
...
lib/static_model.rb
View file @
c6bddeac
...
...
@@ -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'
...
...
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