Revert "DEV: Remove stale ignored_columns from models."
This reverts commit 9f5c8644d0
.
Have to revert because the ignored columns have not been dropped.
This commit is contained in:
parent
c2afc3915b
commit
6fb89c153a
|
@ -1,6 +1,9 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class Badge < ActiveRecord::Base
|
class Badge < ActiveRecord::Base
|
||||||
|
# TODO: Drop in July 2021
|
||||||
|
self.ignored_columns = %w{image}
|
||||||
|
|
||||||
include GlobalPath
|
include GlobalPath
|
||||||
include HasSanitizableFields
|
include HasSanitizableFields
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,11 @@ class Category < ActiveRecord::Base
|
||||||
'none'
|
'none'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# TODO(2020-11-18): remove
|
||||||
|
self.ignored_columns = %w{
|
||||||
|
suppress_from_latest
|
||||||
|
}
|
||||||
|
|
||||||
include Searchable
|
include Searchable
|
||||||
include Positionable
|
include Positionable
|
||||||
include HasCustomFields
|
include HasCustomFields
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
class DirectoryColumn < ActiveRecord::Base
|
class DirectoryColumn < ActiveRecord::Base
|
||||||
|
|
||||||
|
# TODO(2021-06-18): Remove automatic column
|
||||||
|
self.ignored_columns = ["automatic"]
|
||||||
self.inheritance_column = nil
|
self.inheritance_column = nil
|
||||||
|
|
||||||
enum type: { automatic: 0, user_field: 1, plugin: 2 }, _scopes: false
|
enum type: { automatic: 0, user_field: 1, plugin: 2 }, _scopes: false
|
||||||
|
|
|
@ -35,6 +35,9 @@ class EmailToken < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO(2022-01-01): Remove
|
||||||
|
self.ignored_columns = %w{token}
|
||||||
|
|
||||||
def self.scopes
|
def self.scopes
|
||||||
@scopes ||= Enum.new(
|
@scopes ||= Enum.new(
|
||||||
signup: 1,
|
signup: 1,
|
||||||
|
|
|
@ -10,6 +10,9 @@ class EmbeddableHost < ActiveRecord::Base
|
||||||
self.host.sub!(/\/.*$/, '')
|
self.host.sub!(/\/.*$/, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# TODO(2021-07-23): Remove
|
||||||
|
self.ignored_columns = ["path_whitelist"]
|
||||||
|
|
||||||
def self.record_for_url(uri)
|
def self.record_for_url(uri)
|
||||||
|
|
||||||
if uri.is_a?(String)
|
if uri.is_a?(String)
|
||||||
|
|
|
@ -8,6 +8,12 @@ class Invite < ActiveRecord::Base
|
||||||
include RateLimiter::OnCreateRecord
|
include RateLimiter::OnCreateRecord
|
||||||
include Trashable
|
include Trashable
|
||||||
|
|
||||||
|
# TODO(2021-05-22): remove
|
||||||
|
self.ignored_columns = %w{
|
||||||
|
user_id
|
||||||
|
redeemed_at
|
||||||
|
}
|
||||||
|
|
||||||
BULK_INVITE_EMAIL_LIMIT = 200
|
BULK_INVITE_EMAIL_LIMIT = 200
|
||||||
DOMAIN_REGEX = /\A(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/
|
DOMAIN_REGEX = /\A(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)+([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])\z/
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,11 @@ class Post < ActiveRecord::Base
|
||||||
include HasCustomFields
|
include HasCustomFields
|
||||||
include LimitedEdit
|
include LimitedEdit
|
||||||
|
|
||||||
|
self.ignored_columns = [
|
||||||
|
"avg_time", # TODO(2021-01-04): remove
|
||||||
|
"image_url" # TODO(2021-06-01): remove
|
||||||
|
]
|
||||||
|
|
||||||
cattr_accessor :plugin_permitted_create_params, :plugin_permitted_update_params
|
cattr_accessor :plugin_permitted_create_params, :plugin_permitted_update_params
|
||||||
self.plugin_permitted_create_params = {}
|
self.plugin_permitted_create_params = {}
|
||||||
self.plugin_permitted_update_params = {}
|
self.plugin_permitted_update_params = {}
|
||||||
|
|
|
@ -11,6 +11,11 @@ class Topic < ActiveRecord::Base
|
||||||
include LimitedEdit
|
include LimitedEdit
|
||||||
extend Forwardable
|
extend Forwardable
|
||||||
|
|
||||||
|
self.ignored_columns = [
|
||||||
|
"avg_time", # TODO(2021-01-04): remove
|
||||||
|
"image_url" # TODO(2021-06-01): remove
|
||||||
|
]
|
||||||
|
|
||||||
def_delegator :featured_users, :user_ids, :featured_user_ids
|
def_delegator :featured_users, :user_ids, :featured_user_ids
|
||||||
def_delegator :featured_users, :choose, :feature_topic_users
|
def_delegator :featured_users, :choose, :feature_topic_users
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
class TopicTimer < ActiveRecord::Base
|
class TopicTimer < ActiveRecord::Base
|
||||||
MAX_DURATION_MINUTES = 20.years.to_i / 60
|
MAX_DURATION_MINUTES = 20.years.to_i / 60
|
||||||
|
|
||||||
|
self.ignored_columns = [
|
||||||
|
"duration" # TODO(2021-06-01): remove
|
||||||
|
]
|
||||||
|
|
||||||
include Trashable
|
include Trashable
|
||||||
|
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class TopicUser < ActiveRecord::Base
|
class TopicUser < ActiveRecord::Base
|
||||||
|
self.ignored_columns = [
|
||||||
|
:highest_seen_post_number # Remove after 01 Jan 2022
|
||||||
|
]
|
||||||
|
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :topic
|
belongs_to :topic
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,10 @@
|
||||||
require "digest/sha1"
|
require "digest/sha1"
|
||||||
|
|
||||||
class Upload < ActiveRecord::Base
|
class Upload < ActiveRecord::Base
|
||||||
|
self.ignored_columns = [
|
||||||
|
"verified" # TODO(2020-12-10): remove
|
||||||
|
]
|
||||||
|
|
||||||
include ActionView::Helpers::NumberHelper
|
include ActionView::Helpers::NumberHelper
|
||||||
include HasUrl
|
include HasUrl
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,10 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class UserApiKey < ActiveRecord::Base
|
class UserApiKey < ActiveRecord::Base
|
||||||
|
self.ignored_columns = [
|
||||||
|
"scopes" # TODO(2020-12-18): remove
|
||||||
|
]
|
||||||
|
|
||||||
REVOKE_MATCHER = RouteMatcher.new(actions: "user_api_keys#revoke", methods: :post, params: [:id])
|
REVOKE_MATCHER = RouteMatcher.new(actions: "user_api_keys#revoke", methods: :post, params: [:id])
|
||||||
|
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
|
|
|
@ -4,6 +4,9 @@ class UserStat < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
after_save :trigger_badges
|
after_save :trigger_badges
|
||||||
|
|
||||||
|
# TODO(2021-05-13): Remove
|
||||||
|
self.ignored_columns = ["topic_reply_count"]
|
||||||
|
|
||||||
def self.ensure_consistency!(last_seen = 1.hour.ago)
|
def self.ensure_consistency!(last_seen = 1.hour.ago)
|
||||||
reset_bounce_scores
|
reset_bounce_scores
|
||||||
update_distinct_badge_count
|
update_distinct_badge_count
|
||||||
|
|
Loading…
Reference in New Issue