Skip to content
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
10 changes: 10 additions & 0 deletions app/controllers/api/auths_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

class API::AuthsController < API::BaseController
before_action :require_admin_or_mentor_login_for_api
skip_before_action :verify_authenticity_token

def show
head :ok
end
end
2 changes: 1 addition & 1 deletion app/controllers/concerns/authentication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ def require_staff_login_for_api
def require_admin_or_mentor_login_for_api
return if current_user.admin_or_mentor?

render json: { error: '権限がありません' }, status: :forbidden
head :forbidden
end
end
3 changes: 2 additions & 1 deletion config/routes/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
resources :metadata, only: %i(index)
resources :micro_reports, only: %i(update)
resources :trainee_progresses, only: %i(index)
resource :buzz, only: %i(show create destroy), controller: 'buzzes'
resource :buzz, only: %i(show create destroy)
resource :auth, only: %i(show)
end
end
15 changes: 7 additions & 8 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[8.1].define(version: 2026_03_06_064800) do
ActiveRecord::Schema[8.1].define(version: 2026_03_30_072542) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_catalog.plpgsql"
enable_extension "pgcrypto"
Expand Down Expand Up @@ -113,11 +113,11 @@

create_table "buzzes", force: :cascade do |t|
t.datetime "created_at", null: false
t.text "memo"
t.date "published_at", null: false
t.string "title", null: false
t.datetime "updated_at", null: false
t.string "url", null: false
t.string "title", null: false
t.date "published_at", null: false
t.text "memo"
t.index ["url"], name: "index_buzzes_on_url", unique: true
end

Expand Down Expand Up @@ -561,7 +561,7 @@
create_table "pair_work_schedules", force: :cascade do |t|
t.datetime "created_at", null: false
t.bigint "pair_work_id", null: false
t.datetime "proposed_at", null: false
t.datetime "proposed_at", precision: nil, null: false
t.datetime "updated_at", null: false
t.index ["pair_work_id", "proposed_at"], name: "index_pair_work_schedules_on_pair_work_id_and_proposed_at", unique: true
t.index ["pair_work_id"], name: "index_pair_work_schedules_on_pair_work_id"
Expand All @@ -573,8 +573,8 @@
t.datetime "created_at", null: false
t.text "description", null: false
t.bigint "practice_id"
t.datetime "published_at"
t.datetime "reserved_at"
t.datetime "published_at", precision: nil
t.datetime "reserved_at", precision: nil
t.string "title", null: false
t.datetime "updated_at", null: false
t.bigint "user_id", null: false
Expand Down Expand Up @@ -659,7 +659,6 @@
end

create_table "questions", id: :serial, force: :cascade do |t|
t.text "ai_answer"
t.datetime "created_at", precision: nil
t.text "description"
t.bigint "practice_id"
Expand Down