ignore spaminess rating to safely remove database column (#17846)
* ignore spaminess rating to safely remove database column * add spec for ignored columns
This commit is contained in:
parent
fc9bfda0ce
commit
e7fe26862b
2 changed files with 8 additions and 0 deletions
|
|
@ -401,6 +401,8 @@ class Article < ApplicationRecord
|
|||
|
||||
scope :eager_load_serialized_data, -> { includes(:user, :organization, :tags) }
|
||||
|
||||
self.ignored_columns = ["spaminess_rating"]
|
||||
|
||||
def self.seo_boostable(tag = nil, time_ago = 18.days.ago)
|
||||
# Time ago sometimes returns this phrase instead of a date
|
||||
time_ago = 5.days.ago if time_ago == "latest"
|
||||
|
|
|
|||
|
|
@ -13,6 +13,12 @@ RSpec.describe Article, type: :model do
|
|||
include_examples "#sync_reactions_count", :article
|
||||
it_behaves_like "UserSubscriptionSourceable"
|
||||
|
||||
describe "ignored columns" do
|
||||
it "ignores spaminess rating" do
|
||||
expect(described_class.ignored_columns).to eq ["spaminess_rating"]
|
||||
end
|
||||
end
|
||||
|
||||
describe "validations" do
|
||||
it { is_expected.to belong_to(:collection).optional }
|
||||
it { is_expected.to belong_to(:organization).optional }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue