Remove deprecated Organization's columns (#19396)
Co-authored-by: Lawrence <lawrence@forem.com> Co-authored-by: Mac Siri <mac@forem.com> Co-authored-by: Rajat Talesra <rajat@forem.com> Co-authored-by: Mac Siri <krairit.siri@gmail.com>
This commit is contained in:
parent
3bc04bdcc2
commit
c9902fce6a
4 changed files with 8 additions and 4 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
module Search
|
module Search
|
||||||
class OrganizationSerializer < ApplicationSerializer
|
class OrganizationSerializer < ApplicationSerializer
|
||||||
attribute :class_name, -> { "Organization" }
|
attribute :class_name, -> { "Organization" }
|
||||||
attributes :id, :name, :summary, :profile_image, :twitter_username, :nav_image, :slug
|
attributes :id, :name, :summary, :profile_image, :twitter_username, :slug
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
class RemoveNavImageFromOrganizations < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
safety_assured { remove_column :organizations, :nav_image, :string }
|
||||||
|
safety_assured { remove_column :organizations, :dark_nav_image, :string }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -704,14 +704,12 @@ ActiveRecord::Schema[7.0].define(version: 2023_06_22_151553) do
|
||||||
t.string "cta_button_text"
|
t.string "cta_button_text"
|
||||||
t.string "cta_button_url"
|
t.string "cta_button_url"
|
||||||
t.text "cta_processed_html"
|
t.text "cta_processed_html"
|
||||||
t.string "dark_nav_image"
|
|
||||||
t.string "email"
|
t.string "email"
|
||||||
t.string "github_username"
|
t.string "github_username"
|
||||||
t.datetime "last_article_at", precision: nil, default: "2017-01-01 05:00:00"
|
t.datetime "last_article_at", precision: nil, default: "2017-01-01 05:00:00"
|
||||||
t.datetime "latest_article_updated_at", precision: nil
|
t.datetime "latest_article_updated_at", precision: nil
|
||||||
t.string "location"
|
t.string "location"
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.string "nav_image"
|
|
||||||
t.string "old_old_slug"
|
t.string "old_old_slug"
|
||||||
t.string "old_slug"
|
t.string "old_slug"
|
||||||
t.string "profile_image"
|
t.string "profile_image"
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ RSpec.describe Search::OrganizationSerializer do
|
||||||
|
|
||||||
it "serializes a organization" do
|
it "serializes a organization" do
|
||||||
data_hash = described_class.new(organization).serializable_hash.dig(:data, :attributes)
|
data_hash = described_class.new(organization).serializable_hash.dig(:data, :attributes)
|
||||||
expect(data_hash.keys).to include(:id, :name, :summary, :profile_image, :twitter_username, :nav_image, :slug)
|
expect(data_hash.keys).to include(:id, :name, :summary, :profile_image, :twitter_username, :slug)
|
||||||
expect(data_hash[:id]).to eq(organization.id)
|
expect(data_hash[:id]).to eq(organization.id)
|
||||||
expect(data_hash[:name]).to eq(organization.name)
|
expect(data_hash[:name]).to eq(organization.name)
|
||||||
expect(data_hash[:profile_image]).to eq(organization.profile_image)
|
expect(data_hash[:profile_image]).to eq(organization.profile_image)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue