BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e1a3bf30
Unverified
Commit
e1a3bf30
authored
Jul 03, 2017
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ActiverecordSerialize cop
This cop has been renamed to ActiveRecordSerialize to match the way "ActiveRecord" is usually written.
parent
6f1e00ea
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
31 additions
and
31 deletions
+31
-31
application_setting.rb
app/models/application_setting.rb
+7
-7
audit_event.rb
app/models/audit_event.rb
+1
-1
build.rb
app/models/ci/build.rb
+2
-2
trigger_request.rb
app/models/ci/trigger_request.rb
+1
-1
diff_note.rb
app/models/diff_note.rb
+3
-3
event.rb
app/models/event.rb
+1
-1
web_hook_log.rb
app/models/hooks/web_hook_log.rb
+3
-3
legacy_diff_note.rb
app/models/legacy_diff_note.rb
+1
-1
merge_request.rb
app/models/merge_request.rb
+1
-1
merge_request_diff.rb
app/models/merge_request_diff.rb
+2
-2
personal_access_token.rb
app/models/personal_access_token.rb
+1
-1
project_import_data.rb
app/models/project_import_data.rb
+1
-1
sent_notification.rb
app/models/sent_notification.rb
+1
-1
service.rb
app/models/service.rb
+1
-1
user.rb
app/models/user.rb
+1
-1
active_record_serialize.rb
rubocop/cop/active_record_serialize.rb
+1
-1
rubocop.rb
rubocop/rubocop.rb
+1
-1
active_record_serialize_spec.rb
spec/rubocop/cop/active_record_serialize_spec.rb
+2
-2
No files found.
app/models/application_setting.rb
View file @
e1a3bf30
...
@@ -13,13 +13,13 @@ class ApplicationSetting < ActiveRecord::Base
...
@@ -13,13 +13,13 @@ class ApplicationSetting < ActiveRecord::Base
[
\r\n
] # any number of newline characters
[
\r\n
] # any number of newline characters
}x
}x
serialize
:restricted_visibility_levels
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:restricted_visibility_levels
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:import_sources
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:import_sources
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:disabled_oauth_sign_in_sources
,
Array
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:disabled_oauth_sign_in_sources
,
Array
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:domain_whitelist
,
Array
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:domain_whitelist
,
Array
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:domain_blacklist
,
Array
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:domain_blacklist
,
Array
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:repository_storages
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:repository_storages
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:sidekiq_throttling_queues
,
Array
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:sidekiq_throttling_queues
,
Array
# rubocop:disable Cop/Active
R
ecordSerialize
cache_markdown_field
:sign_in_text
cache_markdown_field
:sign_in_text
cache_markdown_field
:help_page_text
cache_markdown_field
:help_page_text
...
...
app/models/audit_event.rb
View file @
e1a3bf30
class
AuditEvent
<
ActiveRecord
::
Base
class
AuditEvent
<
ActiveRecord
::
Base
serialize
:details
,
Hash
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:details
,
Hash
# rubocop:disable Cop/Active
R
ecordSerialize
belongs_to
:user
,
foreign_key: :author_id
belongs_to
:user
,
foreign_key: :author_id
...
...
app/models/ci/build.rb
View file @
e1a3bf30
...
@@ -19,8 +19,8 @@ module Ci
...
@@ -19,8 +19,8 @@ module Ci
)
)
end
end
serialize
:options
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:options
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:yaml_variables
,
Gitlab
::
Serializer
::
Ci
::
Variables
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:yaml_variables
,
Gitlab
::
Serializer
::
Ci
::
Variables
# rubocop:disable Cop/Active
R
ecordSerialize
delegate
:name
,
to: :project
,
prefix:
true
delegate
:name
,
to: :project
,
prefix:
true
...
...
app/models/ci/trigger_request.rb
View file @
e1a3bf30
...
@@ -6,7 +6,7 @@ module Ci
...
@@ -6,7 +6,7 @@ module Ci
belongs_to
:pipeline
,
foreign_key: :commit_id
belongs_to
:pipeline
,
foreign_key: :commit_id
has_many
:builds
has_many
:builds
serialize
:variables
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:variables
# rubocop:disable Cop/Active
R
ecordSerialize
def
user_variables
def
user_variables
return
[]
unless
variables
return
[]
unless
variables
...
...
app/models/diff_note.rb
View file @
e1a3bf30
...
@@ -6,9 +6,9 @@ class DiffNote < Note
...
@@ -6,9 +6,9 @@ class DiffNote < Note
NOTEABLE_TYPES
=
%w(MergeRequest Commit)
.
freeze
NOTEABLE_TYPES
=
%w(MergeRequest Commit)
.
freeze
serialize
:original_position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:original_position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:change_position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:change_position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/Active
R
ecordSerialize
validates
:original_position
,
presence:
true
validates
:original_position
,
presence:
true
validates
:position
,
presence:
true
validates
:position
,
presence:
true
...
...
app/models/event.rb
View file @
e1a3bf30
...
@@ -50,7 +50,7 @@ class Event < ActiveRecord::Base
...
@@ -50,7 +50,7 @@ class Event < ActiveRecord::Base
belongs_to
:target
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
belongs_to
:target
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
# For Hash only
# For Hash only
serialize
:data
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:data
# rubocop:disable Cop/Active
R
ecordSerialize
# Callbacks
# Callbacks
after_create
:reset_project_activity
after_create
:reset_project_activity
...
...
app/models/hooks/web_hook_log.rb
View file @
e1a3bf30
class
WebHookLog
<
ActiveRecord
::
Base
class
WebHookLog
<
ActiveRecord
::
Base
belongs_to
:web_hook
belongs_to
:web_hook
serialize
:request_headers
,
Hash
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:request_headers
,
Hash
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:request_data
,
Hash
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:request_data
,
Hash
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:response_headers
,
Hash
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:response_headers
,
Hash
# rubocop:disable Cop/Active
R
ecordSerialize
validates
:web_hook
,
presence:
true
validates
:web_hook
,
presence:
true
...
...
app/models/legacy_diff_note.rb
View file @
e1a3bf30
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
class
LegacyDiffNote
<
Note
class
LegacyDiffNote
<
Note
include
NoteOnDiff
include
NoteOnDiff
serialize
:st_diff
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:st_diff
# rubocop:disable Cop/Active
R
ecordSerialize
validates
:line_code
,
presence:
true
,
line_code:
true
validates
:line_code
,
presence:
true
,
line_code:
true
...
...
app/models/merge_request.rb
View file @
e1a3bf30
...
@@ -26,7 +26,7 @@ class MergeRequest < ActiveRecord::Base
...
@@ -26,7 +26,7 @@ class MergeRequest < ActiveRecord::Base
belongs_to
:assignee
,
class_name:
"User"
belongs_to
:assignee
,
class_name:
"User"
serialize
:merge_params
,
Hash
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:merge_params
,
Hash
# rubocop:disable Cop/Active
R
ecordSerialize
after_create
:ensure_merge_request_diff
,
unless: :importing?
after_create
:ensure_merge_request_diff
,
unless: :importing?
after_update
:reload_diff_if_branch_changed
after_update
:reload_diff_if_branch_changed
...
...
app/models/merge_request_diff.rb
View file @
e1a3bf30
...
@@ -12,8 +12,8 @@ class MergeRequestDiff < ActiveRecord::Base
...
@@ -12,8 +12,8 @@ class MergeRequestDiff < ActiveRecord::Base
belongs_to
:merge_request
belongs_to
:merge_request
has_many
:merge_request_diff_files
,
->
{
order
(
:merge_request_diff_id
,
:relative_order
)
}
has_many
:merge_request_diff_files
,
->
{
order
(
:merge_request_diff_id
,
:relative_order
)
}
serialize
:st_commits
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:st_commits
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:st_diffs
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:st_diffs
# rubocop:disable Cop/Active
R
ecordSerialize
state_machine
:state
,
initial: :empty
do
state_machine
:state
,
initial: :empty
do
state
:collected
state
:collected
...
...
app/models/personal_access_token.rb
View file @
e1a3bf30
...
@@ -3,7 +3,7 @@ class PersonalAccessToken < ActiveRecord::Base
...
@@ -3,7 +3,7 @@ class PersonalAccessToken < ActiveRecord::Base
include
TokenAuthenticatable
include
TokenAuthenticatable
add_authentication_token_field
:token
add_authentication_token_field
:token
serialize
:scopes
,
Array
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:scopes
,
Array
# rubocop:disable Cop/Active
R
ecordSerialize
belongs_to
:user
belongs_to
:user
...
...
app/models/project_import_data.rb
View file @
e1a3bf30
...
@@ -10,7 +10,7 @@ class ProjectImportData < ActiveRecord::Base
...
@@ -10,7 +10,7 @@ class ProjectImportData < ActiveRecord::Base
insecure_mode:
true
,
insecure_mode:
true
,
algorithm:
'aes-256-cbc'
algorithm:
'aes-256-cbc'
serialize
:data
,
JSON
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:data
,
JSON
# rubocop:disable Cop/Active
R
ecordSerialize
validates
:project
,
presence:
true
validates
:project
,
presence:
true
...
...
app/models/sent_notification.rb
View file @
e1a3bf30
class
SentNotification
<
ActiveRecord
::
Base
class
SentNotification
<
ActiveRecord
::
Base
serialize
:position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:position
,
Gitlab
::
Diff
::
Position
# rubocop:disable Cop/Active
R
ecordSerialize
belongs_to
:project
belongs_to
:project
belongs_to
:noteable
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
belongs_to
:noteable
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
...
...
app/models/service.rb
View file @
e1a3bf30
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# and implement a set of methods
# and implement a set of methods
class
Service
<
ActiveRecord
::
Base
class
Service
<
ActiveRecord
::
Base
include
Sortable
include
Sortable
serialize
:properties
,
JSON
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:properties
,
JSON
# rubocop:disable Cop/Active
R
ecordSerialize
default_value_for
:active
,
false
default_value_for
:active
,
false
default_value_for
:push_events
,
true
default_value_for
:push_events
,
true
...
...
app/models/user.rb
View file @
e1a3bf30
...
@@ -41,7 +41,7 @@ class User < ActiveRecord::Base
...
@@ -41,7 +41,7 @@ class User < ActiveRecord::Base
otp_secret_encryption_key:
Gitlab
::
Application
.
secrets
.
otp_key_base
otp_secret_encryption_key:
Gitlab
::
Application
.
secrets
.
otp_key_base
devise
:two_factor_backupable
,
otp_number_of_backup_codes:
10
devise
:two_factor_backupable
,
otp_number_of_backup_codes:
10
serialize
:otp_backup_codes
,
JSON
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:otp_backup_codes
,
JSON
# rubocop:disable Cop/Active
R
ecordSerialize
devise
:lockable
,
:recoverable
,
:rememberable
,
:trackable
,
devise
:lockable
,
:recoverable
,
:rememberable
,
:trackable
,
:validatable
,
:omniauthable
,
:confirmable
,
:registerable
:validatable
,
:omniauthable
,
:confirmable
,
:registerable
...
...
rubocop/cop/activerecord_serialize.rb
→
rubocop/cop/active
_
record_serialize.rb
View file @
e1a3bf30
...
@@ -3,7 +3,7 @@ require_relative '../model_helpers'
...
@@ -3,7 +3,7 @@ require_relative '../model_helpers'
module
RuboCop
module
RuboCop
module
Cop
module
Cop
# Cop that prevents the use of `serialize` in ActiveRecord models.
# Cop that prevents the use of `serialize` in ActiveRecord models.
class
Active
r
ecordSerialize
<
RuboCop
::
Cop
::
Cop
class
Active
R
ecordSerialize
<
RuboCop
::
Cop
::
Cop
include
ModelHelpers
include
ModelHelpers
MSG
=
'Do not store serialized data in the database, use separate columns and/or tables instead'
.
freeze
MSG
=
'Do not store serialized data in the database, use separate columns and/or tables instead'
.
freeze
...
...
rubocop/rubocop.rb
View file @
e1a3bf30
require_relative
'cop/custom_error_class'
require_relative
'cop/custom_error_class'
require_relative
'cop/gem_fetcher'
require_relative
'cop/gem_fetcher'
require_relative
'cop/activerecord_serialize'
require_relative
'cop/active
_
record_serialize'
require_relative
'cop/redirect_with_status'
require_relative
'cop/redirect_with_status'
require_relative
'cop/polymorphic_associations'
require_relative
'cop/polymorphic_associations'
require_relative
'cop/project_path_helper'
require_relative
'cop/project_path_helper'
...
...
spec/rubocop/cop/activerecord_serialize_spec.rb
→
spec/rubocop/cop/active
_
record_serialize_spec.rb
View file @
e1a3bf30
require
'spec_helper'
require
'spec_helper'
require
'rubocop'
require
'rubocop'
require
'rubocop/rspec/support'
require
'rubocop/rspec/support'
require_relative
'../../../rubocop/cop/activerecord_serialize'
require_relative
'../../../rubocop/cop/active
_
record_serialize'
describe
RuboCop
::
Cop
::
Active
r
ecordSerialize
do
describe
RuboCop
::
Cop
::
Active
R
ecordSerialize
do
include
CopHelper
include
CopHelper
subject
(
:cop
)
{
described_class
.
new
}
subject
(
:cop
)
{
described_class
.
new
}
...
...
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