diff --git a/app/assets/images/git_lab.svg b/app/assets/images/git_lab.svg new file mode 100644 index 000000000..1097fb86b --- /dev/null +++ b/app/assets/images/git_lab.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/assets/images/linked_in.svg b/app/assets/images/linked_in.svg new file mode 100644 index 000000000..88d08f406 --- /dev/null +++ b/app/assets/images/linked_in.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/app/assets/images/stack_overflow.svg b/app/assets/images/stack_overflow.svg new file mode 100644 index 000000000..16dbb4729 --- /dev/null +++ b/app/assets/images/stack_overflow.svg @@ -0,0 +1,3 @@ + + + diff --git a/app/models/profile.rb b/app/models/profile.rb index a013d4647..eaa1ac04b 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -31,6 +31,7 @@ class Profile < ApplicationRecord twitch_url mastodon_url website_url + dribbble_url ].freeze # NOTE: @citizen428 This is a temporary mapping so we don't break DEV during diff --git a/lib/data_update_scripts/20210211164634_fix_profile_field_edge_cases.rb b/lib/data_update_scripts/20210211164634_fix_profile_field_edge_cases.rb new file mode 100644 index 000000000..b9d207789 --- /dev/null +++ b/lib/data_update_scripts/20210211164634_fix_profile_field_edge_cases.rb @@ -0,0 +1,9 @@ +module DataUpdateScripts + class FixProfileFieldEdgeCases + def run + ProfileField.where(attribute_name: %w[git_lab_url linked_in_url stack_overflow_url dribbble_url]) + .update_all(display_area: "settings_only") + ProfileField.where(attribute_name: "skills_languages").update_all(display_area: "left_sidebar") + end + end +end diff --git a/spec/lib/data_update_scripts/fix_profile_field_edge_cases_spec.rb b/spec/lib/data_update_scripts/fix_profile_field_edge_cases_spec.rb new file mode 100644 index 000000000..89b729ca2 --- /dev/null +++ b/spec/lib/data_update_scripts/fix_profile_field_edge_cases_spec.rb @@ -0,0 +1,14 @@ +require "rails_helper" +require Rails.root.join( + "lib/data_update_scripts/20210211164634_fix_profile_field_edge_cases.rb", +) + +describe DataUpdateScripts::FixProfileFieldEdgeCases do + it "migrates profile fields to proper areas" do + # Run the script + described_class.new.run + expect(ProfileField.find_by(attribute_name: "git_lab_url").display_area) + .to eq("settings_only") + expect(ProfileField.find_by(attribute_name: "skills_languages").display_area).to eq("left_sidebar") + end +end