summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-08-29 16:10:49 -0700
committerStan Hu <stanhu@gmail.com>2019-08-30 13:15:34 -0700
commitd93b985df07ccf07541efef709edb8467e0f2955 (patch)
tree6951f100961a2c6b56dfe593daaaaa5a6675f5a4
parentfa6f19d1f83b68f2bb729be889ab7d66adbbedb8 (diff)
downloadgitlab-ce-d93b985df07ccf07541efef709edb8467e0f2955.tar.gz
Use self.ignored_columns += instead of =
This is to accomodate prepended modules.
-rw-r--r--app/models/application_setting.rb16
-rw-r--r--app/models/ci/build.rb16
-rw-r--r--app/models/deploy_key.rb2
-rw-r--r--app/models/note.rb2
-rw-r--r--app/models/notification_setting.rb3
-rw-r--r--app/models/user.rb10
-rw-r--r--doc/development/what_requires_downtime.md2
7 files changed, 25 insertions, 26 deletions
diff --git a/app/models/application_setting.rb b/app/models/application_setting.rb
index 8ff4cba2adb..46259abf1b6 100644
--- a/app/models/application_setting.rb
+++ b/app/models/application_setting.rb
@@ -24,14 +24,14 @@ class ApplicationSetting < ApplicationRecord
serialize :domain_blacklist, Array # rubocop:disable Cop/ActiveRecordSerialize
serialize :repository_storages # rubocop:disable Cop/ActiveRecordSerialize
- self.ignored_columns = %i[
- clientside_sentry_dsn
- clientside_sentry_enabled
- koding_enabled
- koding_url
- sentry_dsn
- sentry_enabled
- ]
+ self.ignored_columns += %i[
+ clientside_sentry_dsn
+ clientside_sentry_enabled
+ koding_enabled
+ koding_url
+ sentry_dsn
+ sentry_enabled
+ ]
cache_markdown_field :sign_in_text
cache_markdown_field :help_page_text
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 6ff89666e53..79a2d5e6e9d 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -17,14 +17,14 @@ module Ci
BuildArchivedError = Class.new(StandardError)
- self.ignored_columns = %i[
- artifacts_file
- artifacts_file_store
- artifacts_metadata
- artifacts_metadata_store
- artifacts_size
- commands
- ]
+ self.ignored_columns += %i[
+ artifacts_file
+ artifacts_file_store
+ artifacts_metadata
+ artifacts_metadata_store
+ artifacts_size
+ commands
+ ]
belongs_to :project, inverse_of: :builds
belongs_to :runner
diff --git a/app/models/deploy_key.rb b/app/models/deploy_key.rb
index 06f8f31b8cc..22ab326a0ab 100644
--- a/app/models/deploy_key.rb
+++ b/app/models/deploy_key.rb
@@ -10,7 +10,7 @@ class DeployKey < Key
scope :are_public, -> { where(public: true) }
scope :with_projects, -> { includes(deploy_keys_projects: { project: [:route, :namespace] }) }
- self.ignored_columns = %i[can_push]
+ self.ignored_columns += %i[can_push]
accepts_nested_attributes_for :deploy_keys_projects
diff --git a/app/models/note.rb b/app/models/note.rb
index c6ef91a27ad..2a0063c76b0 100644
--- a/app/models/note.rb
+++ b/app/models/note.rb
@@ -33,7 +33,7 @@ class Note < ApplicationRecord
end
end
- self.ignored_columns = %i[original_discussion_id]
+ self.ignored_columns += %i[original_discussion_id]
cache_markdown_field :note, pipeline: :note, issuable_state_filter_enabled: true
diff --git a/app/models/notification_setting.rb b/app/models/notification_setting.rb
index 9882f1dc8b3..637c017a342 100644
--- a/app/models/notification_setting.rb
+++ b/app/models/notification_setting.rb
@@ -1,8 +1,7 @@
# frozen_string_literal: true
class NotificationSetting < ApplicationRecord
-
- self.ignored_columns = %i[events]
+ self.ignored_columns += %i[events]
enum level: { global: 3, watch: 2, participating: 1, mention: 4, disabled: 0, custom: 5 }
diff --git a/app/models/user.rb b/app/models/user.rb
index 79c89461806..cb222b87d88 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -23,11 +23,11 @@ class User < ApplicationRecord
DEFAULT_NOTIFICATION_LEVEL = :participating
- self.ignored_columns = %i[
- authentication_token
- email_provider
- external_email
- ]
+ self.ignored_columns += %i[
+ authentication_token
+ email_provider
+ external_email
+ ]
add_authentication_token_field :incoming_email_token, token_generator: -> { SecureRandom.hex.to_i(16).to_s(36) }
add_authentication_token_field :feed_token
diff --git a/doc/development/what_requires_downtime.md b/doc/development/what_requires_downtime.md
index b9d1b95a4d7..f4cee410066 100644
--- a/doc/development/what_requires_downtime.md
+++ b/doc/development/what_requires_downtime.md
@@ -50,7 +50,7 @@ places. This can be done by defining the columns to ignore. For example, to igno
```ruby
class User < ApplicationRecord
- self.ignored_columns = %i[updated_at]
+ self.ignored_columns += %i[updated_at]
end
```