Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 21, 2025

FormDescription URLs now use locale as the route parameter instead of numeric id, making URLs semantic and human-readable.

Changes

Model: Added to_param returning locale

def to_param
  locale
end

Routes: Specified param: :locale on resource

resources :form_descriptions, param: :locale, except: %i(index)

Controller: Changed lookup from find(params[:id]) to find_by!(locale: params[:locale])

Tests: Added routing specs and to_param coverage

URL Examples

# Before
/admin/conferences/rk2025/form_descriptions/123

# After
/admin/conferences/rk2025/form_descriptions/en
/admin/conferences/rk2025/form_descriptions/ja

No view changes required—Rails path helpers automatically invoke to_param.

Original prompt

This section details on the original issue you should resolve

<issue_title>Change admin/form_descriptions param to #locale from #id</issue_title>
<issue_description>Current: /admin/conferences/:slug/form_descriptions/:id
Desired: /admin/conferences/:slug/form_descriptions/:locale

Define to_param in FormDescription then update routes and controllers</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update form_descriptions param to use locale instead of id Change FormDescription routes to use locale parameter instead of id Nov 21, 2025
Copilot AI requested a review from sorah November 21, 2025 08:58
Copilot finished work on behalf of sorah November 21, 2025 08:58
@sorah sorah marked this pull request as ready for review November 21, 2025 12:10
@github-actions
Copy link

Slowest examples

Top 10 slowest examples (6.2 seconds, 56.9% of total time)
Example Description Time in seconds
spec/jobs/create_broadcast_deliveries_job_spec.rb:42 CreateBroadcastDeliveriesJob filters CreateBroadcastDeliveriesJob::Filters::All status all is expected to eq [#<Sponsorship id: 1, accepted_at: "2025-11-21 12:11:29.747284000 +0000", booth_assigned: true, booth...63497000 +0000", url: "https://48.co.invalid", withdrawn_at: "2025-11-21 12:11:30.458697000 +0000">] 0.8144
spec/jobs/create_broadcast_deliveries_job_spec.rb:51 CreateBroadcastDeliveriesJob filters CreateBroadcastDeliveriesJob::Filters::All status active is expected to eq [#<Sponsorship id: 49, accepted_at: "2025-11-21 12:11:30.524023000 +0000", booth_assigned: true, boot...updated_at: "2025-11-21 12:11:30.708189000 +0000", url: "https://64.co.invalid", withdrawn_at: nil>] 0.60597
spec/jobs/create_broadcast_deliveries_job_spec.rb:80 CreateBroadcastDeliveriesJob filters CreateBroadcastDeliveriesJob::Filters::All plan plan1 is expected to eq [#<Sponsorship id: 193, accepted_at: "2025-11-21 12:11:32.331667000 +0000", booth_assigned: true, boo...3403000 +0000", url: "https://232.co.invalid", withdrawn_at: "2025-11-21 12:11:32.798494000 +0000">] 0.60338
spec/jobs/create_broadcast_deliveries_job_spec.rb:69 CreateBroadcastDeliveriesJob filters CreateBroadcastDeliveriesJob::Filters::All status accepted is expected to eq [#<Sponsorship id: 145, accepted_at: "2025-11-21 12:11:31.729575000 +0000", booth_assigned: true, boo...pdated_at: "2025-11-21 12:11:31.912973000 +0000", url: "https://160.co.invalid", withdrawn_at: nil>] 0.60145
spec/jobs/create_broadcast_deliveries_job_spec.rb:100 CreateBroadcastDeliveriesJob filters CreateBroadcastDeliveriesJob::Filters::All locale en is expected to eq [#<Sponsorship id: 289, accepted_at: "2025-11-21 12:11:33.536874000 +0000", booth_assigned: true, boo...4258000 +0000", url: "https://332.co.invalid", withdrawn_at: "2025-11-21 12:11:34.049389000 +0000">] 0.60143
spec/jobs/create_broadcast_deliveries_job_spec.rb:91 CreateBroadcastDeliveriesJob filters CreateBroadcastDeliveriesJob::Filters::All locale ja is expected to eq [#<Sponsorship id: 245, accepted_at: "2025-11-21 12:11:32.982594000 +0000", booth_assigned: true, boo...3491000 +0000", url: "https://288.co.invalid", withdrawn_at: "2025-11-21 12:11:33.498843000 +0000">] 0.60073
spec/jobs/create_broadcast_deliveries_job_spec.rb:60 CreateBroadcastDeliveriesJob filters CreateBroadcastDeliveriesJob::Filters::All status pending is expected to eq [#<Sponsorship id: 113, accepted_at: nil, booth_assigned: true, booth_requested: false, conference_id...pdated_at: "2025-11-21 12:11:31.508638000 +0000", url: "https://128.co.invalid", withdrawn_at: nil>] 0.6003
spec/jobs/create_broadcast_deliveries_job_spec.rb:131 CreateBroadcastDeliveriesJob filters CreateBroadcastDeliveriesJob::Filters::All composite ja active plan is expected to eq [#<Sponsorship id: 445, accepted_at: "2025-11-21 12:11:35.468286000 +0000", booth_assigned: true, boo...pdated_at: "2025-11-21 12:11:35.508979000 +0000", url: "https://448.co.invalid", withdrawn_at: nil>] 0.59385
spec/jobs/create_broadcast_deliveries_job_spec.rb:111 CreateBroadcastDeliveriesJob filters CreateBroadcastDeliveriesJob::Filters::All exhibitor yes is expected to eq [#<Sponsorship id: 337, accepted_at: "2025-11-21 12:11:34.138369000 +0000", booth_assigned: true, boo...6554000 +0000", url: "https://382.co.invalid", withdrawn_at: "2025-11-21 12:11:34.671938000 +0000">] 0.59303
spec/jobs/create_broadcast_deliveries_job_spec.rb:140 CreateBroadcastDeliveriesJob filters CreateBroadcastDeliveriesJob::Filters::All composite ja accepted exhibitors is expected to eq [#<Sponsorship id: 485, accepted_at: "2025-11-21 12:11:35.969254000 +0000", booth_assigned: true, boo...pdated_at: "2025-11-21 12:11:36.079266000 +0000", url: "https://494.co.invalid", withdrawn_at: nil>] 0.59156

@sorah sorah merged commit 30e323a into master Nov 21, 2025
1 check passed
@sorah sorah deleted the copilot/change-form-descriptions-id-to-locale branch November 21, 2025 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change admin/form_descriptions param to #locale from #id

2 participants