Remove Shipping Fields from Users (#6477) [deploy]

This commit is contained in:
Molly Struve 2020-03-05 13:41:09 -05:00 committed by GitHub
parent 45440c7828
commit 039ac2e856
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 20 deletions

View file

@ -32,10 +32,7 @@ class MailchimpBot
ARTICLES: user.articles.size,
COMMENTS: user.comments.size,
ONBOARD_PK: user.onboarding_package_requested.to_s,
EXPERIENCE: user.experience_level || 666,
COUNTRY: user.shipping_country.to_s,
STATE: user.shipping_state.to_s,
POSTAL_ZIP: user.shipping_postal_code.to_s
EXPERIENCE: user.experience_level || 666
}
},
)

View file

@ -138,9 +138,6 @@ class User < ApplicationRecord
validates :config_navbar,
inclusion: { in: %w[default static],
message: "%<value>s is not a valid navbar value" }
validates :shipping_country,
length: { in: 2..2 },
allow_blank: true
validates :website_url, :employer_name, :employer_url,
length: { maximum: 100 }
validates :employment_title, :education, :location,

View file

@ -0,0 +1,14 @@
class RemoveUserShippingFields < ActiveRecord::Migration[5.2]
def change
safety_assured {
remove_column :users, :shipping_name, :string
remove_column :users, :shipping_company, :string
remove_column :users, :shipping_address, :string
remove_column :users, :shipping_address_line_2, :string
remove_column :users, :shipping_city, :string
remove_column :users, :shipping_state, :string
remove_column :users, :shipping_country, :string
remove_column :users, :shipping_postal_code, :string
}
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_03_04_164719) do
ActiveRecord::Schema.define(version: 2020_03_04_220534) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -1223,14 +1223,6 @@ ActiveRecord::Schema.define(version: 2020_03_04_164719) do
t.boolean "saw_onboarding", default: true
t.integer "score", default: 0
t.string "secret"
t.string "shipping_address"
t.string "shipping_address_line_2"
t.string "shipping_city"
t.string "shipping_company"
t.string "shipping_country"
t.string "shipping_name"
t.string "shipping_postal_code"
t.string "shipping_state"
t.boolean "shipping_validated", default: false
t.datetime "shipping_validated_at"
t.string "shirt_gender"

View file

@ -47,10 +47,7 @@ RSpec.describe MailchimpBot, type: :labor do
ARTICLES: user.articles.size,
COMMENTS: user.comments.size,
ONBOARD_PK: user.onboarding_package_requested.to_s,
EXPERIENCE: user.experience_level || 666,
COUNTRY: user.shipping_country.to_s,
STATE: user.shipping_state.to_s,
POSTAL_ZIP: user.shipping_postal_code.to_s
EXPERIENCE: user.experience_level || 666
}
}
}