Remove contact_consent from users (#12196)

This commit is contained in:
Michael Kohl 2021-01-13 04:18:47 +07:00 committed by GitHub
parent 4f40427780
commit b5a9eeb95e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 7 additions and 7 deletions

View file

@ -18,7 +18,6 @@ class Profile < ApplicationRecord
education: :education,
git_lab_url: :gitlab_url,
linked_in_url: :linkedin_url,
recruiters_can_contact_me_about_job_opportunities: :contact_consent,
skills_languages: :mostly_work_with,
stack_overflow_url: :stackoverflow_url
}.with_indifferent_access.freeze

View file

@ -7,7 +7,6 @@ class UserPolicy < ApplicationPolicy
config_font
config_theme
config_navbar
contact_consent
currently_hacking_on
currently_learning
display_announcements

View file

@ -7,7 +7,6 @@ module ProfileFields
field "Employer name", :text_field, placeholder: "Acme Inc.", display_area: "header"
field "Employer URL", :text_field, placeholder: "https://dev.com", display_area: "settings_only"
field "Employment title", :text_field, placeholder: "Junior Frontend Engineer", display_area: "header"
field "Recruiters can contact me about job opportunities", :check_box, display_area: "settings_only"
end
end
end

View file

@ -0,0 +1,5 @@
class DropContactConsentFromUser < ActiveRecord::Migration[6.0]
def change
safety_assured { remove_column :users, :contact_consent }
end
end

View file

@ -1211,7 +1211,6 @@ ActiveRecord::Schema.define(version: 2021_01_11_151630) do
t.datetime "confirmation_sent_at"
t.string "confirmation_token"
t.datetime "confirmed_at"
t.boolean "contact_consent", default: false
t.datetime "created_at", null: false
t.integer "credits_count", default: 0, null: false
t.datetime "current_sign_in_at"

View file

@ -17,7 +17,6 @@ Education,text_field,,,Work,header,false
Employer name,text_field,Acme Inc.,,Work,header,false
Employer URL,text_field,https://dev.com,,Work,header,false
Employment title,text_field,Junior Frontend Engineer,,Work,header,false
Recruiters can contact me about job opportunities,check_box,,,Work,settings_only,false
Skills/Languages,text_area,,What tools and languages are you most experienced with? Are you specialized or more of a generalist?,Coding,left_sidebar,false
Currently learning,text_area,,"What are you learning right now? What are the new tools and languages you're picking up right now?",Coding,left_sidebar,false
Currently hacking on,text_area,,What projects are currently occupying most of your time?,Coding,left_sidebar,false

1 Display email on profile check_box Basic settings_only false
17 Employer name text_field Acme Inc. Work header false
18 Employer URL text_field https://dev.com Work header false
19 Employment title text_field Junior Frontend Engineer Work header false
Recruiters can contact me about job opportunities check_box Work settings_only false
20 Skills/Languages text_area What tools and languages are you most experienced with? Are you specialized or more of a generalist? Coding left_sidebar false
21 Currently learning text_area What are you learning right now? What are the new tools and languages you're picking up right now? Coding left_sidebar false
22 Currently hacking on text_area What projects are currently occupying most of your time? Coding left_sidebar false

View file

@ -15,7 +15,7 @@ describe DataUpdateScripts::CreateProfileFields do
it "creates all profile fields and groups" do
expect do
described_class.new.run
end.to change { profile_field_and_group_count }.from([0, 0]).to([26, 5])
end.to change { profile_field_and_group_count }.from([0, 0]).to([25, 5])
end
end
@ -29,7 +29,7 @@ describe DataUpdateScripts::CreateProfileFields do
expect do
described_class.new.run
end.not_to change { profile_field_and_group_count }
expect(profile_field_and_group_count).to eq [26, 5]
expect(profile_field_and_group_count).to eq [25, 5]
end
end
end