Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Userモデルからexperienceカラムを削除 #8026

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ class User < ApplicationRecord
windows_wsl2: 3
}, _prefix: true

enum experience: {
inexperienced: 0,
html_css: 1,
other_ruby: 2,
ruby: 3,
rails: 4
}, _prefix: true

enum editor: {
vscode: 0,
ruby_mine: 1,
Expand Down
7 changes: 0 additions & 7 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ ja:
job: 職業
os: 利用OS
study_place: 主な学習場所
experience: プログラミング経験
experiences: プログラミング経験
editor: 使用しているエディタ
organization: 現在の所属組織
Expand Down Expand Up @@ -318,12 +317,6 @@ ja:
study_place:
local: フィヨルドブートキャンプオフィス
remote: 自宅
experience:
inexperienced: 未経験
html_css: HTML/CSS経験あり
other_ruby: Ruby以外の言語経験あり
ruby: Ruby経験あり
rails: Rails経験あり
editor:
vscode: VSCode
ruby_mine: RubyMine
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20240822122324_remove_experience_from_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveExperienceFromUsers < ActiveRecord::Migration[6.1]
def change
remove_column :users, :experience, :integer
end
end
3 changes: 1 addition & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_07_12_074411) do
ActiveRecord::Schema.define(version: 2024_08_22_122324) do

# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
Expand Down Expand Up @@ -730,7 +730,6 @@
t.integer "job"
t.string "organization"
t.integer "os"
t.integer "experience"
t.text "retire_reason"
t.boolean "trainee", default: false, null: false
t.boolean "free", default: false, null: false
Expand Down
4 changes: 2 additions & 2 deletions test/integration/discord/users_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
description: '現役生と言います。よろしくお願いします。',
job: 'part_time_worker',
os: 'linux',
experience: 'inexperienced',
experiences: 0,
password: 'passW0rd1234',
password_confirmation: 'passW0rd1234',
coc: 1,
Expand Down Expand Up @@ -61,7 +61,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
description: '研修生と言います。よろしくお願いします。',
job: 'office_worker',
os: 'windows_wsl2',
experience: 'ruby',
experiences: 2,
password: 'passW0rd1234',
password_confirmation: 'passW0rd1234',
coc: 1,
Expand Down
8 changes: 4 additions & 4 deletions test/models/user_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ class UserTest < ActiveSupport::TestCase
course: courses(:course1),
job: 'student',
os: 'mac',
experience: 'ruby',
experiences: 2,
created_at: Time.current - 30.days,
sent_student_followup_message: false
)
Expand All @@ -558,7 +558,7 @@ class UserTest < ActiveSupport::TestCase
course: courses(:course1),
job: 'student',
os: 'mac',
experience: 'ruby',
experiences: 2,
created_at: Time.current,
sent_student_followup_message: false
)
Expand All @@ -578,7 +578,7 @@ class UserTest < ActiveSupport::TestCase
course: courses(:course1),
job: 'student',
os: 'mac',
experience: 'ruby',
experiences: 2,
hibernated_at: nil,
created_at: Time.current - 30.days,
sent_student_followup_message: false
Expand Down Expand Up @@ -610,7 +610,7 @@ class UserTest < ActiveSupport::TestCase
course: courses(:course1),
job: 'student',
os: 'mac',
experience: 'ruby',
experiences: 2,
hibernated_at: nil,
created_at: Time.current - 30.days,
sent_student_followup_message: false
Expand Down
8 changes: 4 additions & 4 deletions test/system/current_user/bookmarks_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CurrentUser::BookmarksTest < ApplicationSystemTestCase
course: courses(:course1),
job: 'office_worker',
os: 'mac',
experience: 'inexperienced'
experiences: 0
)
visit_with_auth '/current_user/bookmarks', user_without_bookmark.login_name
assert_text 'ブックマークはまだありません。'
Expand Down Expand Up @@ -66,7 +66,7 @@ class CurrentUser::BookmarksTest < ApplicationSystemTestCase
course: courses(:course1),
job: 'office_worker',
os: 'mac',
experience: 'inexperienced'
experiences: 0
)
user_with_one_bookmark.bookmarks.create!(bookmarkable_id: reports(:report1).id, bookmarkable_type: 'Report')
visit_with_auth '/current_user/bookmarks', user_with_one_bookmark.login_name
Expand All @@ -91,7 +91,7 @@ class CurrentUser::BookmarksTest < ApplicationSystemTestCase
course: courses(:course1),
job: 'office_worker',
os: 'mac',
experience: 'inexperienced'
experiences: 0
)
(1..20).each do |n|
user_with_some_bookmarks.bookmarks.create!(bookmarkable_id: reports("report#{n}".to_sym).id, bookmarkable_type: 'Report')
Expand All @@ -114,7 +114,7 @@ class CurrentUser::BookmarksTest < ApplicationSystemTestCase
course: courses(:course1),
job: 'office_worker',
os: 'mac',
experience: 'inexperienced'
experiences: 0
)
(1..21).each do |n|
user_with_many_bookmarks.bookmarks.create!(bookmarkable_id: reports("report#{n}".to_sym).id, bookmarkable_type: 'Report')
Expand Down