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
Hide 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
[
\r\n
] # any number of newline characters
}x
serialize
:restricted_visibility_levels
# 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
:domain_whitelist
,
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
:sidekiq_throttling_queues
,
Array
# 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
:disabled_oauth_sign_in_sources
,
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
:repository_storages
# 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
:help_page_text
...
...
app/models/audit_event.rb
View file @
e1a3bf30
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
...
...
app/models/ci/build.rb
View file @
e1a3bf30
...
...
@@ -19,8 +19,8 @@ module Ci
)
end
serialize
:options
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:yaml_variables
,
Gitlab
::
Serializer
::
Ci
::
Variables
# 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
delegate
:name
,
to: :project
,
prefix:
true
...
...
app/models/ci/trigger_request.rb
View file @
e1a3bf30
...
...
@@ -6,7 +6,7 @@ module Ci
belongs_to
:pipeline
,
foreign_key: :commit_id
has_many
:builds
serialize
:variables
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:variables
# rubocop:disable Cop/Active
R
ecordSerialize
def
user_variables
return
[]
unless
variables
...
...
app/models/diff_note.rb
View file @
e1a3bf30
...
...
@@ -6,9 +6,9 @@ class DiffNote < Note
NOTEABLE_TYPES
=
%w(MergeRequest Commit)
.
freeze
serialize
:original_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
:original_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
validates
:original_position
,
presence:
true
validates
:position
,
presence:
true
...
...
app/models/event.rb
View file @
e1a3bf30
...
...
@@ -50,7 +50,7 @@ class Event < ActiveRecord::Base
belongs_to
:target
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
# For Hash only
serialize
:data
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:data
# rubocop:disable Cop/Active
R
ecordSerialize
# Callbacks
after_create
:reset_project_activity
...
...
app/models/hooks/web_hook_log.rb
View file @
e1a3bf30
class
WebHookLog
<
ActiveRecord
::
Base
belongs_to
:web_hook
serialize
:request_headers
,
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
:request_headers
,
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
validates
:web_hook
,
presence:
true
...
...
app/models/legacy_diff_note.rb
View file @
e1a3bf30
...
...
@@ -7,7 +7,7 @@
class
LegacyDiffNote
<
Note
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
...
...
app/models/merge_request.rb
View file @
e1a3bf30
...
...
@@ -26,7 +26,7 @@ class MergeRequest < ActiveRecord::Base
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_update
:reload_diff_if_branch_changed
...
...
app/models/merge_request_diff.rb
View file @
e1a3bf30
...
...
@@ -12,8 +12,8 @@ class MergeRequestDiff < ActiveRecord::Base
belongs_to
:merge_request
has_many
:merge_request_diff_files
,
->
{
order
(
:merge_request_diff_id
,
:relative_order
)
}
serialize
:st_commits
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:st_diffs
# rubocop:disable Cop/Active
r
ecordSerialize
serialize
:st_commits
# rubocop:disable Cop/Active
R
ecordSerialize
serialize
:st_diffs
# rubocop:disable Cop/Active
R
ecordSerialize
state_machine
:state
,
initial: :empty
do
state
:collected
...
...
app/models/personal_access_token.rb
View file @
e1a3bf30
...
...
@@ -3,7 +3,7 @@ class PersonalAccessToken < ActiveRecord::Base
include
TokenAuthenticatable
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
...
...
app/models/project_import_data.rb
View file @
e1a3bf30
...
...
@@ -10,7 +10,7 @@ class ProjectImportData < ActiveRecord::Base
insecure_mode:
true
,
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
...
...
app/models/sent_notification.rb
View file @
e1a3bf30
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
:noteable
,
polymorphic:
true
# rubocop:disable Cop/PolymorphicAssociations
...
...
app/models/service.rb
View file @
e1a3bf30
...
...
@@ -2,7 +2,7 @@
# and implement a set of methods
class
Service
<
ActiveRecord
::
Base
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
:push_events
,
true
...
...
app/models/user.rb
View file @
e1a3bf30
...
...
@@ -41,7 +41,7 @@ class User < ActiveRecord::Base
otp_secret_encryption_key:
Gitlab
::
Application
.
secrets
.
otp_key_base
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
,
: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'
module
RuboCop
module
Cop
# 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
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/gem_fetcher'
require_relative
'cop/activerecord_serialize'
require_relative
'cop/active
_
record_serialize'
require_relative
'cop/redirect_with_status'
require_relative
'cop/polymorphic_associations'
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
'rubocop'
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
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